UFW:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
(创建页面,内容为“'''UFW'''是一套在Linux上常見的防火牆管理軟體,底層通常是iptables。 == 範例 == 建議先設定: <syntaxhighlight lang="bash"> sud…”)
 
第1行: 第1行:
'''UFW'''是一套在[[Linux]]上常見的防火牆管理軟體,底層通常是[[iptables]]。
'''UFW'''是一套在[[Linux]]上常見的防火牆管理軟體,底層通常是[[iptables]]。
== 設定 ==
可以修改<code>/etc/rsyslog.d/20-ufw.conf</code>內的設定,關閉阻擋的log寫到dmesg裡面:
<syntaxhighlight lang="cfg">
# Log kernel generated UFW log messages to file
:msg,contains,"[UFW " /var/log/ufw.log
# Uncomment the following to stop logging anything that matches the last rule.
# Doing this will stop logging kernel generated UFW log messages to the file
# normally containing kern.* messages (eg, /var/log/kern.log)
& stop
</syntaxhighlight>


== 範例 ==
== 範例 ==

2021年2月26日 (五) 05:33的版本

UFW是一套在Linux上常见的防火墙管理软件,底层通常是iptables

设定

可以修改/etc/rsyslog.d/20-ufw.conf内的设定,关闭阻挡的log写到dmesg里面:

# Log kernel generated UFW log messages to file
:msg,contains,"[UFW " /var/log/ufw.log

# Uncomment the following to stop logging anything that matches the last rule.
# Doing this will stop logging kernel generated UFW log messages to the file
# normally containing kern.* messages (eg, /var/log/kern.log)
& stop

范例

建议先设定:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

然后再启用:

sudo ufw enable

相关连结

外部链接