From a6b13228b54ef4b06b116cad3b931b722fba99cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 10 Nov 2022 17:09:44 +0100 Subject: [PATCH] fixup permissions when installing keys --- nix/kexec-installer.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nix/kexec-installer.nix b/nix/kexec-installer.nix index a51a9d6..5f69899 100644 --- a/nix/kexec-installer.nix +++ b/nix/kexec-installer.nix @@ -79,9 +79,10 @@ # Restore ssh host and user keys if they are available. # This avoids warnings of unknown ssh keys. boot.initrd.postMountCommands = '' - mkdir -p /mnt-root/etc/ssh /mnt-root/root/.ssh + mkdir -m 700 -p /mnt-root/root/.ssh + mkdir -m 755 -p /mnt-root/etc/ssh if [[ -f /ssh/authorized_keys ]]; then - cp ssh/authorized_keys /mnt-root/root/.ssh/ + install -m 400 ssh/authorized_keys /mnt-root/root/.ssh fi install -m 400 ssh/ssh_host_* /mnt-root/etc/ssh '';