]> code.ossystems Code Review - openembedded-core.git/commitdiff
openssh: Remove temporary keys before generating new ones
authorAsfak Rahman <asfakr@outlook.com>
Fri, 25 Jun 2021 06:52:57 +0000 (09:52 +0300)
committerAnuj Mittal <anuj.mittal@intel.com>
Tue, 13 Jul 2021 05:53:21 +0000 (13:53 +0800)
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.

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>
(cherry picked from commit 3196249a6917a32491be56e70bbf26d3b9818e0e)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/recipes-connectivity/openssh/openssh/sshd_check_keys

index 1931dc715375f2ec6b7ad356cb1240add98cf8ce..ef117de897ff95f766e56a573f14888507a103eb 100644 (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