News for hackers. Stuff that matters.
Re:Identical Droplets in the DigitalOcean: Regenerate your U... by Nux on Tuesday July 30, 2013 @02:20AM (#6125599)
This is not the last of the problems we'll have with "the cloud", but I guess it's part of what makes it so exciting. :-)

Many people, especially beginners, make the mistake of leaving the same SSH keys in a certain template or in a snapshot of a virtual machine that they later use as a template.

There are a few files that you really, really need to wipe out from a wannabe image template:

- /etc/ssh/* key* (for reasons explained in the parent article. stupid autoformatting, remove the space after the first asterisk)

- /var/lib/random-seed (the seed used to initialise the random number generator. this is the location on CentOS)

- /etc/udev/rules.d/70-persistent-net.rules (so that the VM's new NIC - with a new MAC - can use the same "eth0" name)

People who want to do this more exhaustively can have a look at libguestfs and it's program virt-sysprep which does all of the above and more!

http://libguestfs.org/virt-sysprep.1.html

There are no comments on this comment yet.