Login to new server as root, then add a deploy user
sudo useradd --create-home deploy
sudo adduser deploy sudo
sudo passwd deployUpdate the password, then
Change the new users default to bash by adding /bin/bash to the end of the last line of /etc/passwd
sudo vim /etc/passwdNow login as that user
Make directory .ssh on the remote server
mkdir .ssh
exitAnd add your ssh key to authorized keys
scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys
My hostgator server has something called
jailshellwhich I guess does not allow access to thesudocommand:Plus, I don't know why this happens? Is it not linux?
And most importantly, can you please elaborate why would we need an extra user called
deploy? Is there some reason behind it?Thanks Will. You have amazing tutorials.