summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh/sshd_check_keys')
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshd_check_keys4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd_check_keys b/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
index 1931dc7153..606d1894b5 100644
--- a/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
+++ b/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
@@ -6,6 +6,7 @@ generate_key() {
6 local DIR="$(dirname "$FILE")" 6 local DIR="$(dirname "$FILE")"
7 7
8 mkdir -p "$DIR" 8 mkdir -p "$DIR"
9 rm -f ${FILE}.tmp
9 ssh-keygen -q -f "${FILE}.tmp" -N '' -t $TYPE 10 ssh-keygen -q -f "${FILE}.tmp" -N '' -t $TYPE
10 11
11 # Atomically rename file public key 12 # Atomically rename file public key
@@ -56,8 +57,7 @@ while true ; do
56 esac 57 esac
57done 58done
58 59
59HOST_KEYS=$(sed -n 's/^[ \t]*HostKey[ \t]\+\(.*\)/\1/p' "${sshd_config}") 60HOST_KEYS=$(sshd -G -f "${sshd_config}" | grep -i '^hostkey ' | cut -f2 -d' ')
60[ -z "${HOST_KEYS}" ] && HOST_KEYS="$SYSCONFDIR/ssh_host_rsa_key $SYSCONFDIR/ssh_host_ecdsa_key $SYSCONFDIR/ssh_host_ed25519_key"
61 61
62for key in ${HOST_KEYS} ; do 62for key in ${HOST_KEYS} ; do
63 [ -f $key ] && continue 63 [ -f $key ] && continue