Skip to content

Commit

Permalink
only public key auth
Browse files Browse the repository at this point in the history
  • Loading branch information
james-otten committed Sep 24, 2024
1 parent 91f1108 commit 2df1c1f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ansible/roles/ssh-config/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: Disable password auth
ansible.builtin.lineinfile:
dest: /etc/ssh/sshd_config
regexp: '^#?\s*PasswordAuthentication\s'
line: 'PasswordAuthentication no'
state: present

- name: Restart and enable sshd service
ansible.builtin.service:
name: sshd
state: reloaded
enabled: true

0 comments on commit 2df1c1f

Please sign in to comment.