setup-spoke.sh: write hub host key to root's known_hosts during keyscan to prevent host key prompt during tunnel test

This commit is contained in:
Justin Oros
2026-04-19 21:58:29 -07:00
parent 6fe164a6ae
commit 81d0bebd5e

View File

@@ -319,6 +319,12 @@ if [ -n "$HUB_KEYSCAN" ]; then
if ! grep -qF "$KEYSCAN_KEY" "$SSH_DIR/known_hosts" 2>/dev/null; then
echo "$KEYSCAN_LINE" >> "$SSH_DIR/known_hosts"
fi
mkdir -p /root/.ssh
touch /root/.ssh/known_hosts
chmod 600 /root/.ssh/known_hosts
if ! grep -qF "$KEYSCAN_KEY" /root/.ssh/known_hosts 2>/dev/null; then
echo "$KEYSCAN_LINE" >> /root/.ssh/known_hosts
fi
done <<< "$HUB_KEYSCAN"
fi
check_permissions "$SSH_DIR/known_hosts" "known_hosts"