Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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 5 '12 at 6:49
    
@c2h2 - yes copy those and pub files to the new server. or even better the whole content of /etc/ssh –  pQd Jun 5 '12 at 6:52
    
thanks! I will give a try. –  c2h2 Jun 5 '12 at 6:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.