Add fix permissions on authorized key files

This commit is contained in:
Ethan Paul 2020-03-21 13:10:08 -04:00
parent 58431d1d78
commit cadb79cd26
No known key found for this signature in database
GPG Key ID: D0E2CBF1245E92BF

View File

@ -6,7 +6,7 @@
state: directory
owner: "{{ item.name }}"
group: "{{ item.name }}"
mode: 0644
mode: 0755
loop: "{{ _users_local }}"
- name: Update authorized keys
@ -17,3 +17,13 @@
state: present
exclusive: true
loop: "{{ _users_local }}"
- name: Enforce ownership of authorized keys
become: true
file:
path: /home/{{ item.name }}/.ssh/authorized_keys
state: touch
owner: "{{ item.name }}"
group: "{{ item.name }}"
mode: 0444
loop: "{{ _users_local }}"