Firewall
- UFW
Contents
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 #
ufw enable
ufw disable
Status #
ufw status
ufw status verbose
Open ports #
ufw allow 1234
ufw allow in 1234
ufw allow out 1234
ufw allow in 1234 comment 'Description here'
Remove rules #
- Run
ufw status numbered
to show all rules with a number - Run
ufw remove [number]
to remove a rule