e2b684db by awx

Desactivar usuario root

0 parents
1 ---
2 - name: Desactivar acceso SSH como root
3 hosts: all
4 become: yes
5 tasks:
6
7 - name: Asegurar que 'PermitRootLogin no' esté en sshd_config
8 lineinfile:
9 path: /etc/ssh/sshd_config
10 regexp: '^#?PermitRootLogin\s+.*'
11 line: 'PermitRootLogin no'
12 state: present
13 backrefs: yes
14
15 - name: Asegurar que 'UsePAM yes' esté en sshd_config
16 lineinfile:
17 path: /etc/ssh/sshd_config
18 regexp: '^#?UsePAM\s+.*'
19 line: 'UsePAM yes'
20 state: present
21 backrefs: yes
22
23 - name: Reiniciar el servicio sshd
24 service:
25 name: sshd
26 state: restarted
...\ No newline at end of file ...\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!