Skip to main content

Uncomplicated Firewall - UFW

ufw service information

check status

ufw status

enable ufw

ufw enable

disable ufw

ufw disable

Firewall Policies

default outgoing policy

ufw default allow outgoing

default incoming policy

ufw default deny incoming

Control traffic to services

allow SSH

ufw allow ssh
note

If ssh is not running on a default port 22 then apply the ufw command pointing to the port
Assuming ssh is running on port 2222
ufw allow 2222/tcp

dryrun

       ufw [--dry-run] enable|disable|reload

ufw [--dry-run] default allow|deny|reject [incoming|outgoing|routed]

ufw [--dry-run] logging on|off|LEVEL

ufw [--dry-run] reset

ufw [--dry-run] status [verbose|numbered]

ufw [--dry-run] show REPORT