forked from finn/tinyboard
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user