您的位置:首页 > 其它

Please contact your system administrator. Add correct host key in /Users/***/.ssh/known_hosts

2018-01-24 09:21 423 查看


Please contact your system administrator. Add correct host key in /Users/***/.ssh/known_hosts


macOS系统下ssh root@hostname时遇到如下问题的解决方案:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

The RSA host key for********.com has changed, 

and the key for the corresponding IP address [b]****[/b] 

is unknown. This could either mean that 

DNS SPOOFING is happening or the IP address for the host 

and its host key have changed at the same time. 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 

@ 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 the RSA host key has just been changed. 

The fingerprint for the RSA key sent by the remote host is 
[b]************************[/b]. 

Please contact your system administrator. 

Add correct host key in /Users/***/.ssh/known_hosts to get rid of this message. 

Offending key in /Users/*/.ssh/known_hosts:1 

RSA host key for************** has changed and you have requested strict checking. 

Host key verification failed.

方法1:使用TextMate之类的文本编辑器打开~/.ssh/known_hosts的文件,把hostname对应的行删掉(行首就是你的hostname了,注意:这里的行通常很长,编辑器可能会自动换行。找不到对应的行就全删了也没关系,怕出问题的话可以先备份一下),重新执行命令即可。

方法2:使用命令行工具(推荐iTerm)执行
ssh-keygen -R hostname
即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐