首页 /  技术专区  /  MacOS 宽屏模式 >

Mac ssh时报错WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED

Mac使用ssh连接远程时出现报错:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 ED25519 key sent by the remote host is
SHA256:17QgI/RJT72bRhFqSBvOTMGnIKJvvxENu4FhU+AzFf4.
Please contact your system administrator.
Add correct host key in /Users/allen/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /Users/allen/.ssh/known_hosts:18
Host key for [222.188.64.13]:2205 has changed and you have requested strict checking.
Host key verification failed.

解决方案:

1、找到.ssh文件夹,一般默认地址在Users/allen/中(allen替换为本机用户名)

2、删除本机 .ssh/known_hosts文件中关于222.188.64.13(你需要连接的IP地址)公钥信息

3、或者直接删除.ssh/known_hosts文件

4、重新ssh,成功连接

 ✘ allen@AllendeMacBook-Pro  ~  ssh root@222.188.64.13 -p 2205
The authenticity of host '[222.188.64.13]:2205 ([222.188.64.13]:2205)' can't be established.
ED25519 key fingerprint is SHA256:17QgI/RJT72bRhFqSBvOTMGnIKJvvxENu4FhU+AzFf4.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[222.188.64.13]:2205' (ED25519) to the list of known hosts.
root@222.188.64.13's password:




头像
0/200
图片验证码