Not sure if this is the official way, but I always just:
cp <old>/etc/ssh_* <new>/etc
-Martin
Related to this - maybe you know why I can’t open a connection to my auth agent when I do ssh-add? This is used to create a key with “ssh-keygen” then add it to the server.
There are two ways I know how to resolve this are:
1) User-side, remove any new-server* entries out of their ~/.ssh/known_hosts file and simply reconnect to it.
2) Copy the old-server:/etc/ssh/* onto new-server:/etc/ssh/*.
It looks like you’re proposing to do number (2) and this implies that any
users who currently has “Permanently added new-server to known_hosts”, if they re-connect
to new-server after this change they will receive the same error about :
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
They will still be required to remove new-server out of ~/.ssh/known_hosts file. Even if they’re not accessing Gerrit but simply have connected to it in the past.
[new-server.mydomain.com]:29418 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyo8+\
<truncated>==
We already told you. Copy the ssh_host_* files from the old server's
directory to the new server's etc/ subdirectory, replacing the
ssh_host_* files that were generated during init.
> On 07/27/2010 11:46 AM, End-User1 wrote:
> I think gerrit runs its own ssh server with its own ssh host key. This host key is different from the host key people use to log > into ala-serv1 (outside of gerrit, on port 22). I'd like to make both keys the same (copy ala-serv1:/etc/ssh/ssh_host*key* to > wherever gerrit stores its keys).Yes.
> The person requesting this seems to think Gerrit handles ssh differently:
>
>> On 07/27/2010 11:46 AM, End-User1 wrote:
>
>> I think gerrit runs its own ssh server with its own ssh host key. This
>> host key is different from the host key people use to log > into ala-serv1
>> (outside of gerrit, on port 22). I'd like to make both keys the same (copy
>> ala-serv1:/etc/ssh/ssh_host*key* to > wherever gerrit stores its keys).
>
> I just want to be able to let him know this isn't the case...
End-User1 is right. Gerrit runs its own SSH server, with its own host
key. His instructions to make them the same are correct, assuming you
installed the Bouncy Castle Crypto library. (The library is required
to read the same key format that OpenSSH uses.)