Debian adjustments (constant updates)

— SWAP space setup

  • free -h
  • sudo fallocate -l 1G /swapfile
  • ls -lh /swapfile
  • sudo chmod 600 /swapfile
  • ls -lh /swapfile
  • sudo mkswap /swapfile
  • sudo swapon /swapfile
  • sudo cp /etc/fstab /etc/fstab.bak
  • echo ‘/swapfile none swap sw 0 0’ | sudo tee -a /etc/fstab

— elementary things

  • apt-get update
  • apt-get dist-upgrade -y
  • sudo apt install sudo ufw
  • adduser myuser
  • usermod -aG sudo myuser

— firewall

  • ufw reset
  • ufw allow 22/tcp limit
  • ufw enable

— fail2ban

  • mkdir /var/run/fail2ban
  • apt-get install fail2ban -y
  • cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local
  • cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
  • systemctl restart fail2ban
  • fail2ban-client status
  • if install of fail2ban fails (ubuntu 24.04) – the fix is here: https://discuss.frappe.io/t/fail2ban-fails-on-ubuntu-24-04-lts/127658

— ubuntu 24.04 specific

  • sudo apt remove multipath udisks2
  • sudo apt install ubuntu-advantage-tools