|
|
|
@ -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 |
|
|
|
|
|
|
|
|
|