(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy
And Update the new password
Now login as that user
Make directory .ssh on the remote server and log out
mkdir .ssh
exit
Push your ssh key to the authorized_keys file on the remote server
scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys
@samarthmshah I have pretty much exactly the same questions as you. Have you found the answers yet? I found the answers to one of your questions in te comments section of the video:
Jordan Adams: "The reason to opt for a secondary deploy user is purely security. Normally you'd go ahead and root (limit) this user to the app's location on the server. That way if the deploy account is compromised by for example a disgruntled developer, the rest of the server is safe.
The reason for setting up passwordless auth for this deploy user is so that you don't have to enter a password for each deployment. Instead you're authenticating by a private key on your machine."