Here's how it works:

The SSH package's startup script, (/etc/rc.d/init.d/sshd on Red Hat),
runs the following:

KEYGEN=/usr/bin/ssh-keygen
RSA_KEY=/etc/ssh/ssh_host_rsa_key
...

       if [ ! -s $RSA_KEY ]; then
               echo -n $"Generating SSH2 RSA host key: "
               if $KEYGEN -q -t rsa -f $RSA_KEY -C '' -N ''
>&/dev/null; then
...

So, if /etc/ssh/ssh_host_rsa_key doesn't exist, the instance will
rebuild the RSA key.

The easiest way is to just remove /etc/ssh/ssh_host_rsa_key before you
do your cloning.

- Alex



Post, Mark K wrote:

Yes, that would be a problem.  What you should do is delete the ssh key
files after the cloning has been done.  The first startup of the daemon
should generate new key files.

Mark Post

-----Original Message-----
From: Aria Bamdad [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2003 1:53 PM
To: [EMAIL PROTECTED]
Subject: SSH key and cloning linux images


Hi,


During a fresh linux install, the installation program seems to generate
a key for SSH and perhaps other applications.  If I use this install and
to clone multiple linux images, how do I or do I need to re-generate this
key?  It seems to me that if I don't, then they cloned systems would all
have the same key.  Is this a problem?

Thanks.


Reply via email to