Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit ae76ff18 authored by Robert Nelson's avatar Robert Nelson
Browse files

chroot: delete image ssh_host keys and regenerate on first bootup


Signed-off-by: default avatarRobert Nelson <robertcnelson@gmail.com>
parent 91e4211f
Branches
Tags 6.1.26-ti-arm64-r2
No related merge requests found
......@@ -245,6 +245,10 @@ debian)
case "\$1" in
start|reload|force-reload|restart)
if [ ! -f /etc/ssh/ssh_host_dsa_key.pub ] ; then
rm -rf /etc/ssh/ssh_host_* || true
dpkg-reconfigure openssh-server
fi
if [ -f /boot/uboot/SOC.sh ] && [ -f /boot/uboot/run_boot-scripts ] ; then
if [ -f "/opt/boot-scripts/set_date.sh" ] ; then
/bin/sh /opt/boot-scripts/set_date.sh >/dev/null 2>&1 &
......@@ -281,6 +285,10 @@ ubuntu)
start on runlevel 2
script
if [ ! -f /etc/ssh/ssh_host_dsa_key.pub ] ; then
rm -rf /etc/ssh/ssh_host_* || true
dpkg-reconfigure openssh-server
fi
if [ -f /boot/uboot/SOC.sh ] && [ -f /boot/uboot/run_boot-scripts ] ; then
if [ -f "/opt/boot-scripts/set_date.sh" ] ; then
/bin/sh /opt/boot-scripts/set_date.sh >/dev/null 2>&1 &
......@@ -692,6 +700,10 @@ fi
echo "${user_name}:${password}" | sudo tee ${DIR}/deploy/${export_filename}/user_password.list >/dev/null
#Fixes:
#Remove pre-generated ssh keys, these will be regenerated on first bootup...
sudo rm -rf ${tempdir}/etc/ssh/ssh_host_* || true
report_size
chroot_umount
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment