Generate host keys on first boot with option -p

This commit is contained in:
Gabriele Besta 2020-11-18 19:51:44 +01:00 committed by GitHub
parent 2b6afa184e
commit 6eb7ea8d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -309,6 +309,7 @@ if [[ $prep == true ]]; then
mountdir=$(mktemp -d)
mount "$loopback" "$mountdir"
rm -rvf $mountdir/var/cache/apt/archives/* $mountdir/var/lib/dhcpcd5/* $mountdir/var/log/* $mountdir/var/tmp/* $mountdir/tmp/* $mountdir/etc/ssh/*_host_*
ln -s /lib/systemd/system/regenerate_ssh_host_keys.service $mountdir/etc/systemd/system/multi-user.target.wants/regenerate_ssh_host_keys.service
umount "$mountdir"
fi