From 0543c0847ffccfdcb4038bbad48674ab7b83c10f Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 20 Nov 2022 19:51:15 +0800 Subject: [PATCH] Update firewall_api.py --- class/core/firewall_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/class/core/firewall_api.py b/class/core/firewall_api.py index 9b7e91d0b..9529da878 100755 --- a/class/core/firewall_api.py +++ b/class/core/firewall_api.py @@ -304,10 +304,10 @@ class firewall_api: if status == '1': rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" - conf = re.sub(rep, "PasswordAuthentication yes\n", conf) + conf = re.sub(rep, "PasswordAuthentication no\n", conf) else: rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" - conf = re.sub(rep, "PasswordAuthentication no\n", conf) + conf = re.sub(rep, "PasswordAuthentication yes\n", conf) mw.writeFile(file, conf) mw.execShell("systemctl restart sshd.service") mw.writeLog("SSH管理", msg)