6

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

c2h2
  • 759
  • 2
  • 8
  • 20

1 Answers1

7

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.

pQd
  • 29,561
  • 5
  • 64
  • 106
  • i found the sshd_config file, it says: HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key Shuold I just copy these 3 files to new server? – c2h2 Jun 05 '12 at 06:49
  • @c2h2 - yes copy those and pub files to the new server. or even better the whole content of /etc/ssh – pQd Jun 05 '12 at 06:52