Update firewall.py

This commit is contained in:
dami
2025-09-10 21:38:57 +08:00
parent a0b4681369
commit a00343d444
+2 -2
View File
@@ -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: