- 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