Possible migrating openssh-server fingerprint?

I have upgrade my server to a new OS and newer hardware.

But newly installed OS generated a new set of fingerprint / server keys. Is there anyway I could copy it from my old server to new server. In order to remove the security warning from clients?

EDIT: OS change is from ubuntu 11.10 -> 12.04


Solution 1:

ssh key for the server itself

the files you'd like to migrate are defined in your sshd's config by HostKey directive.

in debian you'd find them in /etc/ssh , under that distro keys are called ssh_host_* ; just search your etc directory for ssh:

find /etc |grep ssh 

you'll find them somewhere. after copying restart your sshd server.

list of 'known hosts'

it's something used to check identity of remote machines when you log in from your server to another computers. you'll find it in your home directory - ~/.ssh/known_hosts. just copy this file from the old server to the new one.