只需要将服务器上的/etc/ssh目录备份、拷贝即可实现改服务器ip或重装openssh-server、系统重装等而不影响客户端连接
如下面报错就可以规避了
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
5c:99:a2:08:02:bf:1b:45:37:ce:96:29:da:c2:e3:dd.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:2
remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R 10.1.81.116
ECDSA host key for 10.1.81.116 has changed and you have requested strict checking.
Host key verification failed.