mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 02:39:26 +08:00
Update firewall.py
This commit is contained in:
@@ -502,7 +502,7 @@ class Firewall(object):
|
|||||||
rep = r"PasswordAuthentication\s+(\w*)\s*\n"
|
rep = r"PasswordAuthentication\s+(\w*)\s*\n"
|
||||||
conf = re.sub(rep, "PasswordAuthentication no\n", conf)
|
conf = re.sub(rep, "PasswordAuthentication no\n", conf)
|
||||||
mw.writeFile(file, conf)
|
mw.writeFile(file, conf)
|
||||||
mw.execShell("systemctl restart sshd")
|
mw.execShell("which systemctl && systemctl restart sshd")
|
||||||
mw.writeLog("SSH管理", msg)
|
mw.writeLog("SSH管理", msg)
|
||||||
return mw.returnData(True, msg)
|
return mw.returnData(True, msg)
|
||||||
|
|
||||||
@@ -530,7 +530,7 @@ class Firewall(object):
|
|||||||
rep = r"PubkeyAuthentication\s+(\w*)\s*\n"
|
rep = r"PubkeyAuthentication\s+(\w*)\s*\n"
|
||||||
content = re.sub(rep, "PubkeyAuthentication no\n", content)
|
content = re.sub(rep, "PubkeyAuthentication no\n", content)
|
||||||
mw.writeFile(file, content)
|
mw.writeFile(file, content)
|
||||||
mw.execShell("systemctl restart sshd")
|
mw.execShell("which systemctl && systemctl restart sshd")
|
||||||
mw.writeLog("SSH管理", msg)
|
mw.writeLog("SSH管理", msg)
|
||||||
return mw.returnData(True, msg)
|
return mw.returnData(True, msg)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user