summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsfak Rahman <asfakr@outlook.com>2021-06-25 09:52:57 +0300
committerAnuj Mittal <anuj.mittal@intel.com>2021-07-13 13:53:21 +0800
commitdceba60f817c61d36868a2def642fc4164ff53ab (patch)
tree7f7ac26f07d5aba31786b06d2e4435f8874d8828
parent373f7c92bab1c08fb895c55553f28539d0b45025 (diff)
downloadopenembedded-core-contrib-dceba60f817c61d36868a2def642fc4164ff53ab.tar.gz
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. 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>
-rw-r--r--meta/recipes-connectivity/openssh/openssh/sshd_check_keys1
1 files changed, 1 insertions, 0 deletions
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