evolinux-base : remove root from AllowUsers directive
when disabling root login, also remove it from AllowUsers if present
This commit is contained in:
parent
79e57b7787
commit
707aabb404
|
@ -88,4 +88,13 @@
|
||||||
notify: reload sshd
|
notify: reload sshd
|
||||||
when: evolinux_root_disable_ssh
|
when: evolinux_root_disable_ssh
|
||||||
|
|
||||||
|
- name: remove root from AllowUsers directive
|
||||||
|
replace:
|
||||||
|
dest: /etc/ssh/sshd_config
|
||||||
|
regexp: '^(AllowUsers ((?!root(?:@\S+)?).)*)(\sroot(?:@\S+)?|root(?:@\S+)?\s)(.*)$'
|
||||||
|
replace: '\1\4'
|
||||||
|
validate: '/usr/sbin/sshd -T -f %s'
|
||||||
|
notify: reload sshd
|
||||||
|
when: evolinux_root_disable_ssh
|
||||||
|
|
||||||
- meta: flush_handlers
|
- meta: flush_handlers
|
||||||
|
|
Loading…
Reference in a new issue