summaryrefslogtreecommitdiff
path: root/roles/sshd/tasks/main.yml
blob: 1c099adbf2418201b06ccb390c96dfd9d55159fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
- name: Disable SSH password authentication
  ansible.builtin.lineinfile:
    dest: /etc/ssh/sshd_config
    state: present
    regexp: ^#?PasswordAuthentication
    line: PasswordAuthentication no
    validate: /usr/sbin/sshd -t -f %s
    owner: root
    group: root
    mode: u+r,g+r,o+r