Initial commit
This commit is contained in:
15
tasks/ssh-config.yml
Normal file
15
tasks/ssh-config.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: Set the appropriate options in sshd_config file
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ sshd_config_file }}"
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
state: present
|
||||
with_items:
|
||||
- { regexp: "^#?PermitRootLogin", line: "PermitRootLogin no" }
|
||||
- { regexp: "^#?PubkeyAuthentication", line: "PubkeyAuthentication yes" }
|
||||
- { regexp: "^#?PubkeyAuthOptions", line: "PubkeyAuthOptions verify-required" } # to enable hardware token
|
||||
- { regexp: "^#?PasswordAuthentication", line: "PasswordAuthentication no" }
|
||||
- { regexp: "^#?KbdInteractiveAuthentication", line: "KbdInteractiveAuthentication no" }
|
||||
- { regexp: "^#?UsePAM", line: "UsePAM yes" } # If no, ansible (passwordless) will not be able to perform SSH
|
||||
notify: Restart sshd
|
||||
Reference in New Issue
Block a user