Skip to content

Instantly share code, notes, and snippets.

@acbilimoria
Last active September 9, 2018 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save acbilimoria/f1f0d2f9cc4f467f24f08ecd0efe54cf to your computer and use it in GitHub Desktop.
Save acbilimoria/f1f0d2f9cc4f467f24f08ecd0efe54cf to your computer and use it in GitHub Desktop.
Initial Server Setup -- Ubuntu 16.04 Digital Ocean
# to run:
# find and replace username with your username
adduser username
usermod -aG sudo username
su - username
mkdir ~/.ssh
chmod 700 ~/.ssh
vim ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
exit
sudo vim /etc/ssh/sshd_config
# change
# PasswordAuthentication no
# PubkeyAuthentication yes
# ChallengeResponseAuthentication no
sudo systemctl reload sshd
sudo ufw allow OpenSSH
sudo ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment