ssh远程连接主机报错:Someone could be eavesdropping on you right now (man-in-the-middle attack)!

ssh连接报错

imaginemiracle:ubuntu_pk$ ssh imaginemiracle@192.168.10.133
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:Kwy5p9J3b2hjU8WQjza45BKMot/7kTBzUHBhgFTgVVfVE.
Please contact your system administrator.
Add correct host key in /home/imaginemiracle/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/imaginemiracle/.ssh/known_hosts:1
  remove with:
  ssh-keygen -f "/home/imaginemiracle/.ssh/known_hosts" -R "[192.168.10.133]:22"
ECDSA host key for [192.168.10.133]:22 has changed and you have requested strict checking.
Host key verification failed.

解决方案

根据ssh连接给出的错误信息不难看出是该设备不能通过远程主机的登录认证,这里可以有两种解决方法。

  • 第一种: 直接删除本地的主机信息,再次连接时(等于第一次连接)会重新生成远程主机信息,命令如下。
imaginemiracle:~$ rm -rf ~/.ssh/known_hosts
  • 第二种: 重新生成远程主机信息,命令如下。
imaginemiracle:~$ ssh-keygen -R [远程主机IP]

以上两种方式均可解决该问题。下面再次尝试登录远程主机,会出现如下输出,输入yes即可进入远程主机目录

imaginemiracle:$ ssh imaginemiracle@192.168.10.133
The authenticity of host '[192.168.10.133]:22 ([192.168.10.133]:22)' can't be established.
ECDSA key fingerprint is SHA256:Kwy5p9BUBShu76yTgsTFJ4DsFsBKMot/7k8GYhGU8gVE.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

到此,ssh的连接问题解决!

  • 4
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Imagine Miracle

爱你哟 =^ v ^=

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值