Last active
September 23, 2024 13:28
-
-
Save acbilimoria/f1f0d2f9cc4f467f24f08ecd0efe54cf to your computer and use it in GitHub Desktop.
Initial Server Setup -- Ubuntu 16.04 Digital Ocean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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