Skip to content
Snippets Groups Projects
Commit 3ce7af98 authored by Markus Gothe's avatar Markus Gothe :ok_hand:
Browse files

openssh: Validate keys and regenerate if needed.


Imitate dropbear init.d-script and make sure we
don't end up with corrupt keys.

Signed-off-by: default avatarMarkus Gothe <markus.gothe@genexis.eu>
parent b834ac01
No related branches found
No related tags found
1 merge request!109openssh: Always make sure /etc/ssh is available.
......@@ -344,6 +344,13 @@ start_service()
do
# check for keys
key=/etc/ssh/ssh_host_${type}_key
[ -f $key ] && {
[ -x /usr/bin/ssh-keygen ] && {
if ! /usr/bin/ssh-keygen -l -f $key > /dev/null 2>&1; then
rm -rf $key
fi
}
}
[ ! -f $key ] && {
# generate missing keys
[ -x /usr/bin/ssh-keygen ] && {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment