|
|
@ -309,10 +309,10 @@ class firewall_api: |
|
|
|
|
|
|
|
|
|
|
|
if status == '1': |
|
|
|
if status == '1': |
|
|
|
rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" |
|
|
|
rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" |
|
|
|
conf = re.sub(rep, "PasswordAuthentication no\n", conf) |
|
|
|
conf = re.sub(rep, "PasswordAuthentication yes\n", conf) |
|
|
|
else: |
|
|
|
else: |
|
|
|
rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" |
|
|
|
rep = "(#)PasswordAuthentication\s+(\w*)\s*\n" |
|
|
|
conf = re.sub(rep, "PasswordAuthentication yes\n", conf) |
|
|
|
conf = re.sub(rep, "PasswordAuthentication no\n", conf) |
|
|
|
mw.writeFile(file, conf) |
|
|
|
mw.writeFile(file, conf) |
|
|
|
mw.execShell("systemctl restart sshd.service") |
|
|
|
mw.execShell("systemctl restart sshd.service") |
|
|
|
mw.writeLog("SSH管理", msg) |
|
|
|
mw.writeLog("SSH管理", msg) |
|
|
|