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
|
- name: Restrict SSH to public key authentication
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/ssh/sshd_config
|
path: /etc/ssh/sshd_config
|
||||||
regexp: '^#?AuthenticationMethods '
|
regexp: '^#?AuthenticationMethods '
|
||||||
line: 'AuthenticationMethods publickey'
|
line: 'AuthenticationMethods publickey'
|
||||||
service: name=sshd state=restarted
|
notify: reload sshd service
|
||||||
|
|
||||||
- name: Disable SSH password authentication
|
- name: Disable SSH password authentication
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/ssh/sshd_config
|
path: /etc/ssh/sshd_config
|
||||||
regexp: '^#?PasswordAuthentication '
|
regexp: '^#?PasswordAuthentication '
|
||||||
line: 'PasswordAuthentication no'
|
line: 'PasswordAuthentication no'
|
||||||
service: name=sshd state=restarted
|
notify: reload sshd service
|
Loading…
Reference in New Issue