From a00343d44440978700fa3c733c96c2e2055d66aa Mon Sep 17 00:00:00 2001 From: dami Date: Wed, 10 Sep 2025 21:38:57 +0800 Subject: [PATCH] Update firewall.py --- web/utils/firewall.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/utils/firewall.py b/web/utils/firewall.py index 3c897e242..0464bebfa 100644 --- a/web/utils/firewall.py +++ b/web/utils/firewall.py @@ -196,7 +196,7 @@ class Firewall(object): if ssh_status[0] != '': status = False - cmd = "systemctl status sshd.service | grep 'dead'|grep -v grep" + cmd = "systemctl status sshd | grep 'dead'|grep -v grep" ssh_status = mw.execShell(cmd) if ssh_status[0] != '': status = False @@ -467,7 +467,7 @@ class Firewall(object): rep = r"(#)?PermitRootLogin\s+(\w*)\s*\n" conf = re.sub(rep, "PermitRootLogin yes\n", conf) - if status == '0': + if status == '1': rep = r"PermitRootLogin\s+(\w*)\s*\n" conf = re.sub(rep, "PermitRootLogin yes\n", conf) else: