autofs: Disable ssh authorized keys from users
When home directories are mounted using NFS and Kerberos the system doesn't have access to authorized_keys file before user logs in.
This commit is contained in:
parent
962787dc04
commit
326caa417d
1 changed files with 15 additions and 0 deletions
|
@ -47,3 +47,18 @@
|
||||||
name: autofs
|
name: autofs
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue