dwyl / learn-microsoft-azure

:cloud: Learn how to deploy your Web Application & Database Server to Microsoft Azure
21 stars 5 forks source link

Deploying Phoenix with non-root User Fails :-\ #11

Open nelsonic opened 7 years ago

nelsonic commented 7 years ago

When dependencies are installed with sudo on an instance they are not accessible to the non-root we are having this issue with HL and the ODBC dependencies ...

I'm investigating our options.

nelsonic commented 7 years ago

investigating logining in as root: https://askubuntu.com/questions/469143/how-to-enable-ssh-root-access-on-ubuntu-14-04

nelsonic commented 7 years ago

Simply adding a password for root is not enough for Ubuntu 14.04 Server.

You also need to edit /etc/ssh/sshd_config, and comment out the following line:

PermitRootLogin without-password

Just below it, add the following line:

PermitRootLogin yes

Then restart SSH:

service ssh restart

for Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-59-generic x86_64) "PermitRootLogin without-password" has been replaced by "PermitRootLogin prohibit-password"

nelsonic commented 7 years ago
root@HLockerstaging2:~/.ssh# cat authorized_keys
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"hladmin\" rather than the user \"root\".';echo;sleep 10" ssh-rsa {MY_SSH_PUBLIC_KEY}
nelsonic commented 7 years ago

removed the command before the SSH Key from /root/.ssh/authorized_keys and now it totes works.

nelsonic commented 7 years ago

** (Mix) Cannot execute task because the project was not yet compiled. When build_embedded is set to true, "MIX_ENV=prod mix compile" must be explicitly executed

I'm now reading through the edeliver wiki: https://github.com/edeliver/edeliver/wiki

nelsonic commented 7 years ago

Running the app in "production" mode works!!

MIX_ENV=prod mix compile
MIX_ENV=prod mix phoenix.server