Generate new SSH keys after OS clone

When using virtual servers cloned from a template, it is advisible to generate new SSH keys to ensure none of your servers are using the same SSH keys.

For Debian/Ubuntu, this is the way to go:

1: Login to the server and become root.

2: Delete the current SSH host keys

# /bin/rm -v /etc/ssh/ssh_host_*

3: Reconfigure OpenSSH Server

Now create a new set of keys on your SSHD server, enter:

# dpkg-reconfigure openssh-server

Sample output:

Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Restarting OpenBSD Secure Shell server: sshd.