print error message to stderr if ssh-keyscan fails

This commit is contained in:
Jörg Thalheim 2023-06-07 07:34:59 +02:00
parent c5fc538880
commit d4fbe4c173

View File

@ -335,7 +335,7 @@ for path in "${!disk_encryption_keys[@]}"; do
done
pubkey=$(ssh-keyscan -p "$ssh_port" -t ed25519 "$ssh_host" 2>/dev/null || {
echo "ERROR: failed to retrieve host public key for ${ssh_connection}"
echo "ERROR: failed to retrieve host public key for ${ssh_connection}" >&2
exit 1
})
pubkey=$(echo "$pubkey" | sed -e 's/^[^ ]* //' | base64 -w0)