Merge pull request #2 from f2k1de/sshd_passwordless

Disallow Password Auth for SSH
main
n0emis 4 years ago committed by GitHub
commit aaefbb0370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,3 +14,5 @@
group: root
mode: 0644
when: motd_path is defined
- include: sshd.yml

@ -0,0 +1,14 @@
---
- name: Restrict SSH to public key authentication
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?AuthenticationMethods '
line: 'AuthenticationMethods publickey'
service: name=sshd state=restarted
- name: Disable SSH password authentication
lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?PasswordAuthentication '
line: 'PasswordAuthentication no'
service: name=sshd state=restarted
Loading…
Cancel
Save