Smile Asked: 2018-03-04 19:05:20 +0800 CST2018-03-04 19:05:20 +0800 CST 2018-03-04 19:05:20 +0800 CST ufw 状态备份为文件 772 我可以通过输入和输入来查看 ufw 状态 须藤 ufw 状态 我想将此作为文件备份。这些信息作为文件驻留在哪里? ufw 1 个回答 Voted Best Answer steeldriver 2018-03-04T19:20:39+08:002018-03-04T19:20:39+08:00 它在文件中/etc/ufw/user.rules,并且/etc/ufw/user6.rules(尽管您可能应该备份整个文件/etc/ufw/) 前任。 $ sudo ufw status Status: active To Action From -- ------ ---- 22/tcp ALLOW Anywhere Samba ALLOW Anywhere 22/tcp (v6) ALLOW Anywhere (v6) Samba (v6) ALLOW Anywhere (v6) 对应 IPv4 和 IPv6RULES部分如下 $ sudo sed '/RULES/,/END RULES/!d' /etc/ufw/user{,6}.rules ### RULES ### ### tuple ### allow tcp 22 0.0.0.0/0 any 0.0.0.0/0 in -A ufw-user-input -p tcp --dport 22 -j ACCEPT ### tuple ### allow udp 137,138 0.0.0.0/0 any 0.0.0.0/0 Samba - in -A ufw-user-input -p udp -m multiport --dports 137,138 -j ACCEPT -m comment --comment 'dapp_Samba' ### tuple ### allow tcp 139,445 0.0.0.0/0 any 0.0.0.0/0 Samba - in -A ufw-user-input -p tcp -m multiport --dports 139,445 -j ACCEPT -m comment --comment 'dapp_Samba' ### END RULES ### ### RULES ### ### tuple ### allow tcp 22 ::/0 any ::/0 in -A ufw6-user-input -p tcp --dport 22 -j ACCEPT ### tuple ### allow udp 137,138 ::/0 any ::/0 Samba - in -A ufw6-user-input -p udp -m multiport --dports 137,138 -j ACCEPT -m comment --comment 'dapp_Samba' ### tuple ### allow tcp 139,445 ::/0 any ::/0 Samba - in -A ufw6-user-input -p tcp -m multiport --dports 139,445 -j ACCEPT -m comment --comment 'dapp_Samba' ### END RULES ###
它在文件中
/etc/ufw/user.rules
,并且/etc/ufw/user6.rules
(尽管您可能应该备份整个文件/etc/ufw/
)前任。
对应 IPv4 和 IPv6
RULES
部分如下