Skip to content

Commit

Permalink
armbian-firstrun: Optionally skip OpenSSH host key regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
davidandreoletti committed Sep 12, 2024
1 parent eb3578a commit da7e9a3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/bsp/common/usr/lib/armbian/armbian-firstrun
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ case "$1" in
[[ -f /etc/systemd/system/armbian-live-patch.service ]] && systemctl --no-reload enable armbian-live-patch.service

# SSH Keys creation
rm -f /etc/ssh/ssh_host*
read entropy_before </proc/sys/kernel/random/entropy_avail
dpkg-reconfigure openssh-server >/dev/null 2>&1
service ssh restart
read entropy_after </proc/sys/kernel/random/entropy_avail
echo -e "\n### [firstrun] Recreated SSH keys (entropy: ${entropy_before} ${entropy_after})" >>${Log}
if [[ "${OPENSSHD_REGENERATE_HOST_KEYS}" == "no" ]]; then
echo -e "\n### [firstrun] SSH host keys unchanged" >>${Log}
else
rm -f /etc/ssh/ssh_host*
read entropy_before </proc/sys/kernel/random/entropy_avail
dpkg-reconfigure openssh-server >/dev/null 2>&1
service ssh restart
read entropy_after </proc/sys/kernel/random/entropy_avail
echo -e "\n### [firstrun] Recreated SSH keys (entropy: ${entropy_before} ${entropy_after})" >>${Log}
fi

# get rid of purple background color in newt apps whiptail, partimage, debconf ... Reverting to Debian look.
[[ -f /etc/newt/palette ]] && sed -e 's/magenta/blue/g' -i /etc/newt/palette
Expand Down

0 comments on commit da7e9a3

Please sign in to comment.