This repository has been archived on 2020-06-04. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-common/handlers/main.yml

23 lines
623 B
YAML
Raw Permalink Normal View History

- 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:
2020-06-04 18:17:49 +00:00
- Run service actions
- name: Disable SSH password authentication
replace:
path: /etc/ssh/sshd_config
regexp: "^.*PasswordAuthentication.*$"
replace: "PasswordAuthentication no"
notify:
2020-06-04 18:17:49 +00:00
- Run service actions