ufw Commands
Uncomplicated Firewall front end.All ufw pages
- sudo ufw reset: delete all ufw rules and start oversudo ufw reset disables ufw and restores the packaged rules files, keeping timestamped backups. What it removes, --force, restoring and rebuilding safely.
- ufw allow 22/tcp: open a port with ufwsudo ufw allow 22/tcp opens a port in the ufw firewall. Ranges, source-restricted rules, app profiles, deleting rules, and the Docker port publishing caveat.
- ufw block an IP address: sudo ufw insert 1 deny from 203.0.113.7Block an IP with ufw insert 1 deny from ADDR or ufw prepend. Why a plain deny after allow rules does nothing, IPv6 positions, Docker ports and checking order.
- ufw limit ssh: rate limit SSH connections against brute forceufw limit ssh denies a source that opens 6 or more connections in 30 seconds. How the rule works, custom ports, rule order, IPv6 and automation pitfalls.