fix: ssh authorized_keys fallback

This commit is contained in:
Clément Désiles
2025-08-26 01:13:19 +02:00
parent e1a1518cb8
commit 2c6da106b2
2 changed files with 13 additions and 6 deletions
+8
View File
@@ -53,6 +53,14 @@
- name: Backup authorized_keys out of HOME dir (if unavailable at startup)
command: "cp /home/{{ item }}/.ssh/authorized_keys {{ssh_authorized_keys_fallback_dir}}/{{ item }}"
loop: "{{ ssh_users.split() }}"
- name: Fix ownership
file:
path: "{{ssh_authorized_keys_fallback_dir}}/{{ item }}"
owner: "{{ item }}"
group: "{{ item }}"
mode: "0600"
loop: "{{ ssh_users.split() }}"
when: ssh_authorized_keys_fallback_enabled
- name: Create an SSH banner