【无标题】ssh登录错误ECDSA host key for ip has changed解决方案

今天重新刷了野火的鲁班猫4,结果导致vscode remote无法登陆
报警信息如下:

[08:56:44.137] > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[08:56:44.165] > @       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> The ECDSA host key for lubancat has changed,
> and the key for the corresponding IP address fe80::a609:ecb1:aa72:b90d%15       
> 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 a host key has just been changed.
> The fingerprint for the ECDSA key sent by the remote host is
> SHA256:+0hETDJN9EkajG2fJ3y2yPkpslEns9VjEkEHVE8ykCE.
> Please contact your system administrator.
> Add correct host key in C:\\Users\\Admin/.ssh/known_hosts to get rid of this mes
> sage.
> Offending ECDSA key in C:\\Users\\Admin/.ssh/known_hosts:11
> ECDSA host key for lubancat has changed and you have requested strict checking. 
> Host key verification failed.
> 过程试图写入的管道不存在。

分析原因发现

It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:+0hETDJN9EkajG2fJ3y2yPkpslEns9VjEkEHVE8ykCE.

这一段警告信息,在网上查询发现

这是由于,ssh连接服务器时,如果之前连接过,ssh会默认保存该ip的连接协议信息,当我们再次访问此ip服务器时,ssh会自动匹配之前ssh保存的信息,由于我们的服务器做了更改,例如重装系统等操作,会导致本地保存的ssh信息失效,于是再次连接时就会出现上述错误。

另外,远程服务器的ssh服务被卸载重装或ssh相关数据(协议信息)被删除也会导致这个错误。

解决方案:

删除本地known_hosts里面的缓存信息即可。命令:ssh-keygen -R “你的远程服务器ip地址”
注意:R是大写!

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值