Skip to content

Instantly share code, notes, and snippets.

@stucka
Last active August 30, 2023 12:37
Show Gist options
  • Save stucka/338a8f4c194313fa1ad0d92c81b2ca3b to your computer and use it in GitHub Desktop.
Save stucka/338a8f4c194313fa1ad0d92c81b2ca3b to your computer and use it in GitHub Desktop.
Setting up a new Linux box
Change root password
make a regular user
adduser stucka
usermod -aG sudo stucka
Set up IP with a DYNDNS entry
Save profile in Putty/SSH client
apt-get update
apt-get dist-upgrade
apt-get clean
apt-get autoremove
maybe do-release-upgrade
apt-get install unattended-upgrades
Then check this BS https://askubuntu.com/questions/1063822/unattended-upgrades-do-not-work-properly
install Apache
apt-get install apache2
ufw allow 'Apache Full'
Install SSL certificate stuff
apt-get install snapd
apt-get remove certbot
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
certbot --apache
ufw allow 'Apache Secure'
ufw deny 'Apache Full'
ufw deny 'Apache'
install fail2ban
https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-ubuntu-22-04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment