summaryrefslogtreecommitdiff
path: root/roles/sshd/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/sshd/tasks/main.yml')
-rw-r--r--roles/sshd/tasks/main.yml10
1 files changed, 10 insertions, 0 deletions
diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml
new file mode 100644
index 0000000..1991564
--- /dev/null
+++ b/roles/sshd/tasks/main.yml
@@ -0,0 +1,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