「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

相關連結

外部連結