ssh host keys on cloned virtual machines

Brian Candler b.candler at
Fri Feb 24 23:39:28 AEDT 2023

Are you doing any other first-boot initialization on the cloned VMs? Are 
you (or could you) use cloud-init for this?

If so, you can run:

     cloud-init clean [--seed] [--logs] [--machine-id]

before cloning - or inside the cloned image using guestfish etc. I'm not 
sure if this actually removes the existing host keys, but if it doesn't, 
you could manually rm them as well.

Then optionally you can provide cloud-init metadata when the clones boot 
if you want to set different network parameters, or perform other 
initialization like creating additional user accounts etc.

More information about the openssh-unix-dev mailing list