題 UFW是活躍的,但沒有啟用為什麼?


我試圖在我的Ubuntu 12.04機器上設置防火牆。經過一番掙扎,我得到了以下內容。這聽起來有點奇怪嗎?

thomas@thomas-K40IJ:~$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip

To                         Action      From
--                         ------      ----
21/tcp                     ALLOW OUT   Anywhere
80                         ALLOW OUT   Anywhere
22                         ALLOW OUT   Anywhere
21/tcp                     ALLOW OUT   Anywhere (v6)
80                         ALLOW OUT   Anywhere (v6)
22                         ALLOW OUT   Anywhere (v6)

thomas@thomas-K40IJ:~$ sudo ufw reload
Firewall not enabled (skipping reload)
thomas@thomas-K40IJ:~$ sudo ufw enable 
ERROR: Could not load logging rules
thomas@thomas-K40IJ:~$

重啟後我的防火牆似乎也被禁用了。我錯過了什麼?


4
2018-05-02 13:29


起源


關閉日誌記錄(sudo ufw logging off)解決了這個問題。 - Thomas
使用GUFW圖形用戶界面進行UFW(簡單防火牆)更容易... - Prasad RD


答案:


mateusz@debian:~$ sudo ufw disable
Firewall stopped and disabled on system startup

mateusz@debian:~$ sudo ufw status verbose
Status: inactive

mateusz@debian:~$ sudo ufw enable
ERROR: problem running ufw-init

即使發生錯誤,您也可以檢查ufw是否正在運行。

mateusz@debian:~$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip

To                         Action      From
--                         ------      ----
80/tcp                     ALLOW IN    Anywhere
22/tcp                     ALLOW IN    Anywhere

要么

mateusz@debian:~$ sudo service ufw status
[ ok all is running...done.

您可以輕鬆手動設置 ENABLED=yes 在ufw配置中

sudo nano /etc/ufw/ufw.conf

其中包含:

# /etc/ufw/ufw.conf
#

# Set to yes to start on boot. If setting this remotely, be sure to add a rule
# to allow your remote connection before starting ufw. Eg: 'ufw allow 22/tcp'
ENABLED=no

# Please use the 'ufw' command to set the loglevel. Eg: 'ufw logging medium'.
# See 'man ufw' for details.
LOGLEVEL=low

9
2017-09-18 10:35





ufw 有一個圖形界面,可以幫助您更輕鬆地設置防火牆。它應該默認安裝,但如果你沒有,請使用 sudo apt-get install gufw
以下是其使用指南 https://help.ubuntu.com/community/Gufw


0
2018-05-02 15:42