26 lines
633 B
YAML
26 lines
633 B
YAML
|
- name: Turn off password authentication
|
||
|
become: true
|
||
|
replace:
|
||
|
path: /etc/ssh/sshd_config
|
||
|
regexp: "PasswordAuthentication yes"
|
||
|
replace: "PasswordAuthentication no"
|
||
|
|
||
|
- name: Turn off challenge response authentication
|
||
|
become: true
|
||
|
replace:
|
||
|
path: /etc/ssh/sshd_config
|
||
|
regexp: "ChallengeResponseAuthentication yes"
|
||
|
replace: "ChallengeResponseAuthentication no"
|
||
|
|
||
|
- name: Turn off GSSAPI authentication
|
||
|
become: true
|
||
|
replace:
|
||
|
path: /etc/ssh/sshd_config
|
||
|
regexp: "GSSAPIAuthentication yes"
|
||
|
replace: "GSSAPIAuthentication no"
|
||
|
|
||
|
- name: Restart sshd
|
||
|
service:
|
||
|
name: sshd
|
||
|
state: restarted
|