Add fix permissions on authorized key files
This commit is contained in:
parent
58431d1d78
commit
cadb79cd26
@ -6,7 +6,7 @@
|
|||||||
state: directory
|
state: directory
|
||||||
owner: "{{ item.name }}"
|
owner: "{{ item.name }}"
|
||||||
group: "{{ item.name }}"
|
group: "{{ item.name }}"
|
||||||
mode: 0644
|
mode: 0755
|
||||||
loop: "{{ _users_local }}"
|
loop: "{{ _users_local }}"
|
||||||
|
|
||||||
- name: Update authorized keys
|
- name: Update authorized keys
|
||||||
@ -17,3 +17,13 @@
|
|||||||
state: present
|
state: present
|
||||||
exclusive: true
|
exclusive: true
|
||||||
loop: "{{ _users_local }}"
|
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 }}"
|
||||||
|
Reference in New Issue
Block a user