forked from ansible-lockdown/RHEL9-CIS
PermitRootLogin found in /etc/ssh/sshd_config.d/01-permitrootlogin.conf
Signed-off-by: Bas Meijer <bas.meijer@me.com>
This commit is contained in:
parent
3fe681c0d2
commit
baf8987a5f
1 changed files with 12 additions and 5 deletions
|
|
@ -150,11 +150,18 @@
|
|||
- rule_5.2.6
|
||||
|
||||
- name: "5.2.7 | PATCH | Ensure SSH root login is disabled"
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ rhel9_cis_sshd_config_file }}"
|
||||
regexp: "^#PermitRootLogin|^PermitRootLogin"
|
||||
line: 'PermitRootLogin no'
|
||||
validate: sshd -t -f %s
|
||||
block:
|
||||
- name: "5.2.7 | PATCH | Ensure SSH root login is disabled | config file"
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ rhel9_cis_sshd_config_file }}"
|
||||
regexp: "^#PermitRootLogin|^PermitRootLogin"
|
||||
line: 'PermitRootLogin no'
|
||||
validate: sshd -t -f %s
|
||||
|
||||
- name: "5.2.7 | PATCH | Ensure SSH root login is disabled | override file"
|
||||
ansible.builtin.file:
|
||||
path: /etc/ssh/sshd_config.d/01-permitrootlogin.conf
|
||||
state: absent
|
||||
when:
|
||||
- rhel9cis_rule_5_2_7
|
||||
tags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue