Copying known_hosts between computers

known-hostsssh

Connect to a server using OpenSSH_5.9p1 OpenSSL 1.0.1, and it stores a .ssh/known_hosts that's of the format:

|1|wwwwwwwwwwwwwww=|wwwwwwwwww= ecdsa-sha2-nistp256 AAAAAAAAAA+AAAAA=

Then copy that known_hosts file to another PC running OpenSSH_4.5p1 OpenSSL 0.9.8d, and it gives the "authenticity can't be established, are you sure you want to continue connecting" message, as if the known_hosts file was't right.

When that second PC stores the known_hosts for the same server, it writes it in the format:

[10.2.3.4]:22 ssh-rsa AAAAAAAAAA/BBBBB/CCCCCC//DDDDDD

Is there a way to convert between the two formats?

Best Answer

Your first example contains an ECDSA key (ecdsa-sha2-nistp256), which were introduced in OpenSSH 5.7.

OpenSSH 4.5 only supports RSA and DSA keys (ssh-rsa and ssh-dss), and ignores your known_hosts entry.

Related Question