roles/websites: Set authorized_keys file perms
Because the various "webapp.*" users' home directories are under `/srv/www`, the default SELinux context type is `httpd_sys_content_t`. The SSH daemon is not allowed to read files with this label, so it cannot load the contents of these users' `authorized_keys` files. To address this, we have to explicitly set the SELinux type to `ssh_home_t`.
This commit is contained in:
@@ -36,6 +36,13 @@
|
||||
key: "{{ dchwww_publisher_keys|join('\n') }}"
|
||||
user: webapp.dchwww
|
||||
exclusive: true
|
||||
- name: ensure authorized_keys file permissions are correct
|
||||
file:
|
||||
path: /srv/www/dustin.hatch.name/.ssh/authorized_keys
|
||||
mode: '0600'
|
||||
owner: webapp.dchwww
|
||||
group: webapp.dchwww
|
||||
setype: ssh_home_t
|
||||
|
||||
- name: ensure virtualenv exists
|
||||
become: true
|
||||
|
||||
Reference in New Issue
Block a user