UFW 处于活动状态但未启用为什么?

Tho*_*mas 8 firewall ufw ubuntu

我试图在我的 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:~$
Run Code Online (Sandbox Code Playgroud)

重启后我的防火墙似乎也被禁用了。我错过了什么?

Mat*_*usz 13

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
Run Code Online (Sandbox Code Playgroud)

即使发生错误,您也可以检查 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
Run Code Online (Sandbox Code Playgroud)

或者

mateusz@debian:~$ sudo service ufw status
[ ok all is running...done.
Run Code Online (Sandbox Code Playgroud)

您可以ENABLED=yes在 ufw config 中轻松手动设置

sudo nano /etc/ufw/ufw.conf
Run Code Online (Sandbox Code Playgroud)

其中包含:

# /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
Run Code Online (Sandbox Code Playgroud)