博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ssh远程登录出现Host key verification failed.解决办法
阅读量:4939 次
发布时间:2019-06-11

本文共 2552 字,大约阅读时间需要 8 分钟。

今天通过ssh和域名连接主机:

IcarusdeMacBook-Pro:~ icarus$ ssh root@icarusyu.me

出现了如下错误:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@The ECDSA host key for icarusyu.me has changed,and the key for the corresponding IP address 165.227.52.49is unchanged. This could either mean thatDNS SPOOFING is happening or the IP address for the hostand its host key have changed at the same time.Offending key for IP in /Users/icarus/.ssh/known_hosts:4@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    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 isSHA256:dcs240xWGNTvHg1qUkrkg4Pzb1pYzCgzghTHlEG+uZ0.Please contact your system administrator.Add correct host key in /Users/icarus/.ssh/known_hosts to get rid of this message.Offending ECDSA key in /Users/icarus/.ssh/known_hosts:3ECDSA host key for icarusyu.me has changed and you have requested strict checking.Host key verification failed.

 提示中出现了关键信息:

Add correct host key in /Users/icarus/.ssh/known_hosts to get rid of this message.Offending ECDSA key in /Users/icarus/.ssh/known_hosts:3

  原因是在主机子系统每次成功ssh连接远程操作,都会把你每个你访问过计算机的公钥(public key)都记录在主机的目录/Users/icarus/.ssh/known_hosts下,当下次访问相同子机服务器时,会核对公钥。如果公钥不同,会发出警告,避免你受到DNS Hijack之类的攻击。

解决办法:

进入目录删除文件即可,然后重新连接就能发现连接上了。

IcarusdeMacBook-Pro:~ icarus$ cd ~/.ssh/IcarusdeMacBook-Pro:.ssh icarus$ lsknown_hosts	known_hosts.oldIcarusdeMacBook-Pro:.ssh icarus$ rm known_hostsIcarusdeMacBook-Pro:.ssh icarus$ ssh root@icarusyu.meThe authenticity of host 'icarusyu.me (165.227.52.49)' can't be established.ECDSA key fingerprint is SHA256:dcs240xWGNTvHg1qUkrkg4Pzb1pYzCgzghTHlEG+uZ0.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'icarusyu.me,165.227.52.49' (ECDSA) to the list of known hosts.root@icarusyu.me's password: Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-116-generic x86_64) * Documentation:  https://help.ubuntu.com * Management:     https://landscape.canonical.com * Support:        https://ubuntu.com/advantage  Get cloud support with Ubuntu Advantage Cloud Guest:    http://www.ubuntu.com/business/services/cloud

  

  

 

转载于:https://www.cnblogs.com/IcarusYu/p/8621699.html

你可能感兴趣的文章
[zz]使用 libevent 和 libev 提高网络应用性能
查看>>
jQuery ajax - getJSON() 用法实例
查看>>
python输出带颜色的字体
查看>>
Linux故障处理最佳实践
查看>>
6标准文件读写
查看>>
jsTree 核心功能(core functionality) API
查看>>
Perl oop链接数据库
查看>>
安卓开发16:Spinner 下拉列表控件
查看>>
参数数据自动生成app架构设计【一】
查看>>
网络虚拟化我眼中的OpenFlow
查看>>
多线程笔记1
查看>>
[leetcode] 3. Longest Substring Without Repeating Characters
查看>>
06 Frequently Asked Questions (FAQ) 常见问题解答 (常见问题)
查看>>
itemController.java
查看>>
获取判断IE版本 TypeError: Cannot read property 'msie' of undefined
查看>>
tcpreplay安装使用
查看>>
用systemtap对sysbench IO测试结果的分析1
查看>>
自增锁
查看>>
ps命令学习
查看>>
关于proteus仿真的串口问题
查看>>