我怎样才能从 shell 禁用 SuSEfirewall2(不使用 yast)?
我们使用 OpenSuSE 12.3
我尝试过这个:
workdevel123:~ # systemctl disable SuSEfirewall2.service
但我认为这不是解决方案:
workdevel123:~ # systemctl is-enabled SuSEfirewall2.service
Failed to issue method call: No such file or directory
答案1
至少在 openSUSE 12.1 中防火墙仍然分为两个组件/etc/init.d
:
# systemctl disable SuSEfirewall2_setup.service
SuSEfirewall2_setup.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig SuSEfirewall2_setup off
# systemctl disable SuSEfirewall2_init.service
SuSEfirewall2_init.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig SuSEfirewall2_init off
但是,使用 systemctl 而不仅仅是chkconfig --set SuSEfirewall2_setup off
“更具未来性”。
顺序很重要。_setup 依赖于 _init。
答案2
OpenSUSE 13.2 中以下内容:
/sbin/SuSEfirewall2 关闭
(从http://binwaheed.blogspot.com/2011/02/opensuse-turn-firewall-off.html)
答案3
虽然/sbin/SuSEfirewall2 off
是正确的,但您也可以这样做systemctl
:
systemctl -q is-enabled SuSEfirewall2 && systemctl disable SuSEfirewall2
systemctl -q is-active SuSEfirewall2 && systemctl stop SuSEfirewall2