Compare commits

...
2 Commits
Author SHA1 Message Date
dami c239f35382 Update firewall.py 2026-09-02 08:25:34 +08:00
dami 49d57af719 Update linux.conf 2026-08-27 13:36:19 +08:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ vm.max_map_count = 262144
# error:table full, dropping packet.
net.nf_conntrack_max = 25000000
net.netfilter.nf_conntrack_max = 25000000
net.netfilter.ip_conntrack_tcp_timeout_established = 30
# net.netfilter.ip_conntrack_tcp_timeout_established = 30
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 10
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 5
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 5
+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)