homeserver/roles/mgrote.deactivate_ssh_password_login/tasks/main.yml
2020-12-25 20:56:42 +01:00

11 lines
300 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 -f %s"
notify: restart_sshd