Update firewall_api.py

pull/458/head
midoks 2 years ago
parent 49a358ccfa
commit 8bc9500b23
  1. 11
      class/core/firewall_api.py

@ -214,14 +214,11 @@ class firewall_api:
data['pass_prohibit_status'] = False
# 密码登陆配置检查
pass_rep = "#PasswordAuthentication\s+(\w*)\s*\n"
pass_rep = "^PasswordAuthentication\s+(\w*)\s*\n"
pass_status = re.search(pass_rep, conf)
if pass_status:
data['pass_prohibit_status'] = True
if not data['pass_prohibit_status']:
pass_rep = "PasswordAuthentication\s+(\w*)\s*\n"
pass_status = re.search(pass_rep, conf)
if not pass_status:
# pass_rep = "PasswordAuthentication\s+(\w*)\s*\n"
# pass_status = re.search(pass_rep, conf)
if pass_status and pass_status.groups(0)[0].strip() == 'no':
data['pass_prohibit_status'] = True

Loading…
Cancel
Save