ufw 防火牆重開機後停用

ufw 防火牆重開機後停用

在 Debian Buster 上我安裝了 UFW 防火牆

然而,啟用後

$ ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup

重啟後防火牆被停用

$ ufw status
Status: inactive

設定檔如下所示:

nano /etc/ufw/ufw.conf
ENABLED=yes

非常感謝幫忙!

答案1

您需要透過服務管理員啟用該服務。

sudo systemctl start ufw    # starts the service 
sudo systemctl enable ufw   # starts the service on boot

答案2

ufw enable也應該這樣做。查看第一個輸出:

Firewall is active and enabled on system startup

不過,您的建議是:

$ sudo systemctl enable ufw
Synchronizing state of ufw.service with SysV service script with /lib/systemd/systemd- 
sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ufw

沒有效果:

$ ufw status
Status: inactive

相關內容