Update firewall.py

This commit is contained in:
dami
2026-09-02 08:25:34 +08:00
parent 49d57af719
commit c239f35382
+2 -2
View File
@@ -502,7 +502,7 @@ class Firewall(object):
rep = r"PasswordAuthentication\s+(\w*)\s*\n"
conf = re.sub(rep, "PasswordAuthentication no\n", conf)
mw.writeFile(file, conf)
mw.execShell("systemctl restart sshd")
mw.execShell("which systemctl && systemctl restart sshd")
mw.writeLog("SSH管理", msg)
return mw.returnData(True, msg)
@@ -530,7 +530,7 @@ class Firewall(object):
rep = r"PubkeyAuthentication\s+(\w*)\s*\n"
content = re.sub(rep, "PubkeyAuthentication no\n", content)
mw.writeFile(file, content)
mw.execShell("systemctl restart sshd")
mw.execShell("which systemctl && systemctl restart sshd")
mw.writeLog("SSH管理", msg)
return mw.returnData(True, msg)