users, ensure home and its immediate subdirectories are owned by the user.
This commit is contained in:
1 parent
cea7e03c11
commit
71bcb7c351
1 file changed
+7
-1
@@ -124,9 +124,14 @@
|
|||||||
when: user_user.home != "" and coding
|
when: user_user.home != "" and coding
|
||||||
|
|
||||||
- name: General | Account Management | Users | Home Permissions
|
- name: General | Account Management | Users | Home Permissions
|
||||||
ansible.builtin.shell: "chmod 700 {{ user_user.home }}/../*"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
register: shell_check
|
register: shell_check
|
||||||
changed_when: shell_check.rc == 0
|
changed_when: shell_check.rc == 0
|
||||||
|
loop:
|
||||||
|
- "chmod 700 {{ user_user.home }}/../*"
|
||||||
|
- "chown {{ user }}:{{ user }} {{ user_user.home }}"
|
||||||
|
- "chown {{ user }}:{{ user }} {{ user_user.home }}/*"
|
||||||
|
- "chown {{ user }}:{{ user }} {{ user_user.home }}/.*"
|
||||||
|
|
||||||
|
|
||||||
## Files ##
|
## Files ##
|
||||||
@@ -1402,6 +1407,7 @@
|
|||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ user_user.home }}/{{ item }}"
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop:
|
loop:
|
||||||
- .bashrc
|
- .bashrc
|
||||||
|
|||||||
Reference in new issue
Block a user