10 lines
294 B
YAML
10 lines
294 B
YAML
---
|
|
- name: prohibit ssh login with password
|
|
become: yes
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/ssh/sshd_config
|
|
regexp: '#PasswordAuthentication yes'
|
|
line: 'PasswordAuthentication no'
|
|
state: present
|
|
validate: "/usr/sbin/sshd -T"
|
|
notify: restart_sshd
|