added more logging for various key-regen actions

This commit is contained in:
Sean 2022-11-14 15:07:22 -08:00
parent 0f8996443c
commit 570f9cbbe8
1 changed files with 5 additions and 3 deletions

View File

@ -331,6 +331,7 @@ if [[ $prep == true ]]; then
dd if=/dev/hwrng of=/dev/urandom count=1 bs=4096 status=none dd if=/dev/hwrng of=/dev/urandom count=1 bs=4096 status=none
fi fi
rm -f $mountdir/etc/ssh/ssh_host_*_key* rm -f $mountdir/etc/ssh/ssh_host_*_key*
info "regenerating ssh host keys"
ssh-keygen -A -f $mountdir > /dev/null ssh-keygen -A -f $mountdir > /dev/null
fi fi
fi fi
@ -341,9 +342,10 @@ if [[ $prep == true ]]; then
info "WARNING: could not locate dropbearkey command, keeping old keys" info "WARNING: could not locate dropbearkey command, keeping old keys"
else else
rm -f $mountdir/etc/dropbear/dropbear_*_host_key rm -f $mountdir/etc/dropbear/dropbear_*_host_key
dropbearkey -t rsa -f $mountdir/etc/dropbear/dropbear_rsa_host_key info "regenerating dropbear keys"
dropbearkey -t ecdsa -f $mountdir/etc/dropbear/dropbear_ecdsa_host_key dropbearkey -t rsa -f $mountdir/etc/dropbear/dropbear_rsa_host_key > /dev/null
dropbearkey -t ed25519 -f $mountdir/etc/dropbear/dropbear_ed25519_host_key dropbearkey -t ecdsa -f $mountdir/etc/dropbear/dropbear_ecdsa_host_key > /dev/null
dropbearkey -t ed25519 -f $mountdir/etc/dropbear/dropbear_ed25519_host_key > /dev/null
fi fi
fi fi
umount "$mountdir" umount "$mountdir"