1. UFW


ufw, uncomplicated firewall is a simple firewall command line utility.

Example: Setup for SSH #

This will block all incoming connections by default and creates an execption for SSH (port 22):

ufw default deny incoming
ufw allow in ssh
ufw enable

Warning: if you are running this on a VPS you can be locked out if you acidentaly block your SSH port. You can fix this by opening the recovery environment and running ufw disable.

Enable/disable #

Status #

Open ports #

Remove rules #

  1. Run ufw status numbered to show all rules with a number
  2. Run ufw remove [number] to remove a rule