Skip to content

Instantly share code, notes, and snippets.

@vn-tienle
Last active August 21, 2017 06:09
Show Gist options
  • Select an option

  • Save vn-tienle/9744f962d0ba2a855516938d440c5f07 to your computer and use it in GitHub Desktop.

Select an option

Save vn-tienle/9744f962d0ba2a855516938d440c5f07 to your computer and use it in GitHub Desktop.
Adding a deploy user in Ubuntu Linux

(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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment