Skip to content

Commit 7b15b0e

Browse files
bors[bot]Mic92
andauthored
Merge #133
133: Ssh keyscan fixes r=Mic92 a=Mic92 Co-authored-by: Jörg Thalheim <[email protected]>
2 parents 8aa9b49 + d4fbe4c commit 7b15b0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nixos-anywhere.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ if [[ -n ${ssh_private_key_file-} ]]; then
224224
fi
225225

226226
ssh_settings=$(ssh -G "${ssh_connection}")
227-
ssh_host=$(echo "$ssh_settings" | awk '/^host / { print $2 }')
227+
ssh_host=$(echo "$ssh_settings" | awk '/^hostname / { print $2 }')
228228
ssh_port=$(echo "$ssh_settings" | awk '/^port / { print $2 }')
229229

230230
step Uploading install SSH keys
@@ -335,7 +335,7 @@ for path in "${!disk_encryption_keys[@]}"; do
335335
done
336336

337337
pubkey=$(ssh-keyscan -p "$ssh_port" -t ed25519 "$ssh_host" 2>/dev/null || {
338-
echo "ERROR: failed to retrieve host public key for ${ssh_connection}"
338+
echo "ERROR: failed to retrieve host public key for ${ssh_connection}" >&2
339339
exit 1
340340
})
341341
pubkey=$(echo "$pubkey" | sed -e 's/^[^ ]* //' | base64 -w0)

0 commit comments

Comments
 (0)