diff --git a/build.sh b/build.sh index 45e79d1..ed34923 100755 --- a/build.sh +++ b/build.sh @@ -211,6 +211,21 @@ EOF apply_patch '01-no-root-login.diff' +rm -fv '/etc/ssh/ssh_host_key' +rm -fv '/etc/ssh/ssh_host_key.pub' + +rm -fv '/etc/ssh/ssh_host_dsa_key' +rm -fv '/etc/ssh/ssh_host_dsa_key.pub' + +rm -fv '/etc/ssh/ssh_host_ecdsa_key' +rm -fv '/etc/ssh/ssh_host_ecdsa_key.pub' + +rm -fv '/etc/ssh/ssh_host_ed25519_key' +rm -fv '/etc/ssh/ssh_host_ed25519_key.pub' + +rm -fv '/etc/ssh/ssh_host_rsa_key' +rm -fv '/etc/ssh/ssh_host_rsa_key.pub' + ## # ????? # diff --git a/files/rc.local b/files/rc.local index 675e509..8313f5a 100755 --- a/files/rc.local +++ b/files/rc.local @@ -14,4 +14,8 @@ # Increase root file system size to take all available space. resize2fs "$(findmnt / -o source -n)" +# Generate the default host keys for each of the key types +# for which host keys do not exist (rsa1, rsa, dsa, ecdsa and ed25519). +ssh-keygen -A + exit 0