From 0cd61e9ff967396c2989a2bf23e22a7977c75df6 Mon Sep 17 00:00:00 2001 From: binary Date: Wed, 20 Jan 2021 09:47:17 +0100 Subject: Force syncrhonization of ssh keys --- roles/sshd/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'roles') 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 -- cgit v1.2.3