Skip to content

Instantly share code, notes, and snippets.

@Xeoncross Xeoncross/ubuntu_setup.sh
Last active Oct 14, 2019

Embed
What would you like to do?
Setup a new user on Ubuntu 18+ VPS
# Assuming you are logged in as root and the ssh key you want to use already installed for root (i.e. new Digital Ocean VPS)
adduser deploy
usermod -aG sudo deploy
mkdir /home/deploy/.ssh
cp /root/.ssh/authorized_keys /home/deploy/.ssh/
chmod 700 /home/deploy/.ssh
chown deploy:deploy -R /home/deploy/.ssh
# Now switch to user and create a deployment ssh key (if desired)
su - deploy
cd /home/deploy/.ssh/
ssh-keygen -f id_rsa -t rsa -N ''
@Xeoncross

This comment has been minimized.

Copy link
Owner Author

Xeoncross commented Oct 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.