From 6e4f6716286d834338590a595c8a6f7071d663f5 Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 20 Nov 2022 20:07:50 +0800 Subject: [PATCH] up --- 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 d32e18f66..54f25ee7c 100755 --- a/class/core/firewall_api.py +++ b/class/core/firewall_api.py @@ -308,10 +308,10 @@ class firewall_api: conf = mw.readFile(file) if status == '1': - rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" + rep = "(#)?PasswordAuthentication\s+(\w*)\s*\n" conf = re.sub(rep, "PasswordAuthentication yes\n", conf) else: - rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" + rep = "(#)?PasswordAuthentication\s+(\w*)\s*\n" conf = re.sub(rep, "PasswordAuthentication no\n", conf) mw.writeFile(file, conf) mw.execShell("systemctl restart sshd.service")