diff --git a/roles/autofs/tasks/main.yml b/roles/autofs/tasks/main.yml index 3e22f3d..49506be 100644 --- a/roles/autofs/tasks/main.yml +++ b/roles/autofs/tasks/main.yml @@ -47,3 +47,18 @@ name: autofs state: started enabled: true + +- name: disable authorized_keys file from users + lineinfile: + path: /etc/ssh/sshd_config + line: AuthorizedKeysFile none + regexp: '^AuthorizedKeysFile\s+.*' + notify: restart sshd + +- name: enable authorized_keys file for root + blockinfile: + path: /etc/ssh/sshd_config + block: | + Match User root + AuthorizedKeysFile .ssh/authorized_keys + notify: restart sshd