accounts: use a variable for sshd PermitRootLogin

This commit is contained in:
Jérémy Dubois 2022-09-02 17:16:30 +02:00
parent aed61c3df6
commit 3d941a99a3
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1,2 @@
---
evobsd_root_login: "no"

View File

@ -107,8 +107,8 @@
- name: "Disable root login"
replace:
dest: /etc/ssh/sshd_config
regexp: '^PermitRootLogin (yes|without-password|prohibit-password)'
replace: "PermitRootLogin no"
regexp: '^PermitRootLogin\s+(yes|without-password|prohibit-password)'
replace: "PermitRootLogin {{ evobsd_root_login }}"
notify: reload sshd
tags:
- accounts