Working with the ufw configuration files

You can find the ufw firewall rules in the /etc/ufw directory. As you can see, the rules are stored in several different files:

donnie@ubuntu-ufw:/etc/ufw$ ls -ltotal 48-rw-r----- 1 root root  915 Aug  7 15:23 after6.rules-rw-r----- 1 root root 1126 Jul 31 14:31 after.init-rw-r----- 1 root root 1004 Aug  7 15:23 after.rulesdrwxr-xr-x 3 root root 4096 Aug  7 16:45 applications.d-rw-r----- 1 root root 6700 Mar 25 17:14 before6.rules-rw-r----- 1 root root 1130 Jul 31 14:31 before.init-rw-r----- 1 root root 3467 Aug 11 11:36 before.rules-rw-r--r-- 1 root root 1391 Aug 15  2017 sysctl.conf-rw-r--r-- 1 root root  313 Aug 11 11:37 ufw.conf-rw-r----- 1 root root 3014 Aug 11 11:37 user6.rules-rw-r----- 1 root root ...

Get Mastering Linux Security and Hardening - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.