From ec6731f752f2bf5c6bf448a88adcd2f1a78a1a63 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sat, 13 Sep 2025 21:26:18 +0200 Subject: [PATCH] Add copy host known hosts to borg-client --- modules/borg-client.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/borg-client.nix b/modules/borg-client.nix index 5d15b6f..bf29613 100644 --- a/modules/borg-client.nix +++ b/modules/borg-client.nix @@ -300,6 +300,12 @@ in cp -r /home/yanlin/.ssh/keys /root/.ssh/ chmod -R 600 /root/.ssh/keys fi + + # Copy known_hosts to avoid host key verification issues + if [ -f /home/yanlin/.ssh/known_hosts ]; then + cp /home/yanlin/.ssh/known_hosts /root/.ssh/known_hosts + chmod 600 /root/.ssh/known_hosts + fi fi # Pre-hook @@ -475,6 +481,12 @@ in cp -r /home/yanlin/.ssh/keys /root/.ssh/ chmod -R 600 /root/.ssh/keys fi + + # Copy known_hosts to avoid host key verification issues + if [ -f /home/yanlin/.ssh/known_hosts ]; then + cp /home/yanlin/.ssh/known_hosts /root/.ssh/known_hosts + chmod 600 /root/.ssh/known_hosts + fi fi # Run the integrity check script