UFW Firewall

  1. Install with:
    apt update
    sudo apt install ufw
  2. Check preset profiles and allow necessary services as root:
    sudo ufw app list
    sudo ufw allow OpenSSH
    sudo ufw allow "Apache Full"
    sudo ufw allow Samba
    sudo ufw allow 1194 # OpenVPN
    sudo ufw allow 3493 # NUT
    sudo ufw allow <custom port>/tcp # FTP
    sudo ufw allow <custom port:range> # FTP passive port range
  3. Enable firewall and check status:
    ufw enable
    sudo ufw status
  4. Remove firewall rule:
    sudo ufw status numbered
    sudo ufw delete <rule number>