在这里记录在Mac终端下连接远程主机出现的所有问题以及解决方案,以做备用
1.出现WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! 问题
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 RSA key sent by the remote host is
SHA256:hXwzq2j3We9wb......
Please contact your system administrator.
Add correct host key in /Users/xu/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/xxx/.ssh/known_hosts:1
RSA host key for [0.0.0.0]:0 has changed and you have requested strict checking.
Host key verification failed.
原因:会出现这个问题是远程主机重装了系统造成的,客户端与主机首次建立连接时记录了双方的公钥,重装系统之后主机的公钥改变了,用旧的公钥与改变了公钥的主机当然连接不上啦
解决方案:删除客户端的~/.ssh/known_hosts文件就OK了(查看隐藏文件:shift+command+.)