You add a rule like this:
ufw allow 22/tcp
The rule is saved, and is applied even after reboot. But it's not written anywhere in /etc/ufw
. Where is it saved to? (Ubuntu, using ufw as pre-installed.)
You add a rule like this:
ufw allow 22/tcp
The rule is saved, and is applied even after reboot. But it's not written anywhere in /etc/ufw
. Where is it saved to? (Ubuntu, using ufw as pre-installed.)
In my Ubuntu 11 server, the firewall rules are saved in
/lib/ufw/user.rules
Ubuntu 16.04 LTS
/etc/ufw/user.rules
Debian 9
/etc/ufw/user.rules
In general, try:
locate user.rules
Should output something like:
I believe it's under
lib/ufw/rules[6].rules
In my version, 8.04 LTS Server the files are stored in
/var/lib/ufw
as/var/lib/ufw/user.rules
and/var/lib/ufw/user6.rules
.This should work on all Linux systems assuming a ".rules" suffix and residing beneath a directory named "ufw":
Using the "ls -l" shows that some of them are links to others, and which ones have been updated most recently (implying they are active?)