Respecting cloning vm guests, I see in /etc/ssh the following:
ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_key ssh_host_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub
Is there a simple script somewhere to regenerate all the server host keys for the new guest after cloning?
On Wed, Jan 4, 2012 at 8:08 PM, James B. Byrne byrnejb@harte-lyne.ca wrote:
Respecting cloning vm guests, I see in /etc/ssh the following:
ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_key ssh_host_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub
Is there a simple script somewhere to regenerate all the server host keys for the new guest after cloning?
Simple, just remove them and boot the server or restart sshd:
# rm -f /etc/ssh/ssh_host*key*; /etc/init.d/sshd restart Stopping sshd: [ OK ] Generating SSH1 RSA host key: [ OK ] Generating SSH2 RSA host key: [ OK ] Generating SSH2 DSA host key: [ OK ] Starting sshd: [ OK ]
-- Mikael Fridh
On Wed, January 4, 2012 14:08, James B. Byrne wrote:
Is there a simple script somewhere to regenerate all the server host keys for the new guest after cloning?
The init script /etc/rc.d/init.d/sshd handles it.
I discover that simply removing the existing ssh keys from /etc/ssh and restarting the sshd service causes the host keys to be regenerated.
Another step to add to post cloning housekeeping.