From 7de42197339d42b7055874bc320cdb0f686cd5cb Mon Sep 17 00:00:00 2001 From: Asfak Rahman Date: Fri, 25 Jun 2021 09:52:57 +0300 Subject: openssh: Remove temporary keys before generating new ones Key generation may wait for user input, due to the existence of temporary keys resulting from power interruption in the first boot. This prevents users from login via ssh. (From OE-Core rev: dceba60f817c61d36868a2def642fc4164ff53ab) Signed-off-by: Asfak Rahman Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie (cherry picked from commit 3196249a6917a32491be56e70bbf26d3b9818e0e) Signed-off-by: Anuj Mittal Signed-off-by: Richard Purdie --- meta/recipes-connectivity/openssh/openssh/sshd_check_keys | 1 + 1 file changed, 1 insertion(+) (limited to 'meta/recipes-connectivity') diff --git a/meta/recipes-connectivity/openssh/openssh/sshd_check_keys b/meta/recipes-connectivity/openssh/openssh/sshd_check_keys index 1931dc7153..ef117de897 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() { local DIR="$(dirname "$FILE")" mkdir -p "$DIR" + rm -f ${FILE}.tmp ssh-keygen -q -f "${FILE}.tmp" -N '' -t $TYPE # Atomically rename file public key -- cgit v1.2.3-54-g00ecf