adduser example_user
adduser example_user sudo OR usermod -aG sudo example_user
mkdir ~/.ssh chmod 700 ~/.ssh vim ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
- disable password authentication
- disable root login over ssh
sudo vim /etc/ssh/sshd_config PasswordAuthentication no PermitRootLogin no
sudo systemctl reload sshd sudo service sshd restart
sudo ufw app list sudo ufw allow OpenSSH sudo ufw enable sudo ufw status
sudo apt-get update && sudo apt-get upgrade sudo apt-get install nginx
sudo ufw allow 'Nginx HTTP' sudo ufw allow 'Nginx HTTPS'
https://www.linode.com/docs/guides/remove-unused-network-facing-services
sudo systemctl stop nginx
mkdir /var/www/sitename/html cp /etc/nginx/ /etc/nginx/sites-available/sitename vim /etc/nginx/sites-available/sitename ln /etc/nginx/sites-enabled/sitename /etc/nginx/sites-available/sitename
- https://becomesovran.com/blog/server-setup-basics.html
- https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04
- https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-22-04
- https://www.linode.com/docs/websites/hosting-a-website
- https://www.linode.com/docs/guides/how-to-install-and-use-nginx-on-ubuntu-20-04/
- https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04
https://www.linode.com/docs/security/securing-your-server
https://www.linode.com/docs/guides/security/ https://www.linode.com/docs/guides/using-fail2ban-to-secure-your-server-a-tutorial/