Add copy host known hosts to borg-client

This commit is contained in:
Yan Lin 2025-09-13 21:26:18 +02:00
parent 05bfef728b
commit ec6731f752

View file

@ -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