1
0
Fork 0
home-ansible/roles/ssh/tasks/main.yml

15 lines
388 B
YAML
Raw Normal View History

2022-12-21 22:56:39 -05:00
---
- name: Block root and password authentication
lineinfile:
path: /etc/ssh/sshd_config
regexp: '{{ item.regexp }}'
line: '{{ item.line }}'
validate: 'sshd -T -f %s'
state: present
with_items:
- regexp: '^PasswordAuthentication'
line: 'PasswordAuthentication no'
2023-10-15 22:55:26 -04:00
- regexp: '^#PermitRootLogin'
2022-12-21 22:56:39 -05:00
line: 'PermitRootLogin no'
notify: Restart ssh