Formatting plus notify in sshd; allow username instead of only name in
variables; use which instead of command - Formatting + notify in sshd config - Use which instead of command (because of problems with sudo [no such file or directory]) - Allow using username instead of name in variables (because of compliance with oh-my-zsh role (https://github.com/gantsign/ansible-role-oh-my-zsh))main
parent
3438e661a3
commit
884710fb1f
@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: reload sshd service
|
||||
systemd:
|
||||
name: sshd.service
|
||||
state: reloaded
|
@ -1,14 +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
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: '^#?AuthenticationMethods '
|
||||
line: 'AuthenticationMethods publickey'
|
||||
notify: reload sshd service
|
||||
|
||||
- name: Disable SSH password authentication
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: '^#?PasswordAuthentication '
|
||||
line: 'PasswordAuthentication no'
|
||||
notify: reload sshd service
|
Loading…
Reference in New Issue