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: 3196249a6917a32491be56e70bbf26d3b9818e0e)

Signed-off-by: Asfak Rahman <asfakr@outlook.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Asfak Rahman
2021-06-25 09:52:57 +03:00
committed by Richard Purdie
parent 692c2b3652
commit 567b7e3060

View File

@@ -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