2020-01-22 08:31:27 +01:00
|
|
|
# $OpenBSD: keyscan.sh,v 1.13 2020/01/22 07:31:27 dtucker Exp $
|
2002-05-01 05:17:33 +02:00
|
|
|
# Placed in the Public Domain.
|
|
|
|
|
|
|
|
tid="keyscan"
|
|
|
|
|
2019-12-16 03:39:05 +01:00
|
|
|
for i in $SSH_KEYTYPES; do
|
2019-01-27 07:30:53 +01:00
|
|
|
if [ -z "$algs" ]; then
|
|
|
|
algs="$i"
|
|
|
|
else
|
|
|
|
algs="$algs,$i"
|
|
|
|
fi
|
|
|
|
done
|
2019-01-28 04:50:39 +01:00
|
|
|
echo "HostKeyAlgorithms $algs" >> $OBJ/sshd_config
|
2019-01-27 07:30:53 +01:00
|
|
|
|
2002-05-01 05:17:33 +02:00
|
|
|
start_sshd
|
|
|
|
|
2019-12-16 03:39:05 +01:00
|
|
|
for t in $SSH_KEYTYPES; do
|
2002-05-01 05:17:33 +02:00
|
|
|
trace "keyscan type $t"
|
2020-01-22 08:31:27 +01:00
|
|
|
${SSHKEYSCAN} -t $t -T 15 -p $PORT 127.0.0.1 127.0.0.1 127.0.0.1 \
|
2002-05-01 05:17:33 +02:00
|
|
|
> /dev/null 2>&1
|
|
|
|
r=$?
|
|
|
|
if [ $r -ne 0 ]; then
|
|
|
|
fail "ssh-keyscan -t $t failed with: $r"
|
|
|
|
fi
|
|
|
|
done
|