23 lines
623 B
YAML
23 lines
623 B
YAML
- name: Disable the root account
|
|
user:
|
|
name: root
|
|
password: '!'
|
|
password_lock: yes
|
|
notify:
|
|
- Disable SSH login for root
|
|
- Disable SSH password authentication
|
|
- name: Disable SSH login for root
|
|
replace:
|
|
path: /etc/ssh/sshd_config
|
|
regexp: "^.*PermitRootLogin.*$"
|
|
replace: "PermitRootLogin no"
|
|
notify:
|
|
- Run service actions
|
|
- name: Disable SSH password authentication
|
|
replace:
|
|
path: /etc/ssh/sshd_config
|
|
regexp: "^.*PasswordAuthentication.*$"
|
|
replace: "PasswordAuthentication no"
|
|
notify:
|
|
- Run service actions
|