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