aboutsummaryrefslogtreecommitdiffstats
path: root/roles/sshd
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2021-01-20 09:47:17 +0100
committerbinary <me@rgoncalves.se>2021-01-20 09:47:17 +0100
commit0cd61e9ff967396c2989a2bf23e22a7977c75df6 (patch)
tree2edb9f662e80ad79800c1a6e1aab0d8105910b5f /roles/sshd
parent28cab93735128358542fe9374930f448636aa557 (diff)
downloadinfrastructure-0cd61e9ff967396c2989a2bf23e22a7977c75df6.tar.gz
Force syncrhonization of ssh keys
Diffstat (limited to 'roles/sshd')
-rw-r--r--roles/sshd/tasks/main.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml
index 8c032ee..db46aad 100644
--- a/roles/sshd/tasks/main.yml
+++ b/roles/sshd/tasks/main.yml
@@ -33,6 +33,14 @@
ignore_errors: true
loop: "{{ keys.files }}"
+- name: chown ssh file to correct user
+ file:
+ path: "/home/{{ item.path | dirname | basename }}/.ssh/authorized_keys"
+ owner: "{{ item.path | dirname | basename }}"
+ mode: 0600
+ ignore_errors: true
+ loop: "{{ keys.files }}"
+
- name: restart sshd
service:
name: sshd
remember that computers suck.