We have lots of scripts that run over ssh through saved (passwordless) key pairs. Both clients and servers are CentOS 6.x.I know that if you get a new client computer (where the scripts are run from), you can just copy the ~/.ssh/known_hosts from the old computer to the new one.
But if I am replacing the server that that workstation connects to, what do I copy to preserve the key pair? I tried copying the contents of /etc/ssh. After I did this, I no longer got the "the key has changed" refusal to connect on the client, but I still had to enter the password.
I've googled this and can't find much. What am I doing wrong?