【无标题】ssh配置

SSH连接时,出现提示远程密码重置的报错

[root@docker tools]# ssh 172.17.0.2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 RSA key sent by the remote host is
  A256:egegjw6C/fb8Oy/Ipkt41NBTHhWNVwU1Hq1Jg/tp9q8.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:3
RSA host key for 172.17.0.2 has changed and you have requested strict checking.
Host key verification failed.

    
    
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

先查看文件在哪里

[root@docker tools]# cat /root/.ssh/known_hosts
172.17.0.2 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzQu4f6rXtaWxPqU7MSTbRkn2NbNGNef5pwzIH+MrNWWCsXft2MjraMtXq5R5/EF7Bxpi2XSPcx4i6YMNjAz+muRwM/riaupCCQx3doAm0zLKk14LNFil8gRswIQsUS98rHAR6xtaC4I/tW0ISQB/7ssLbc9S6dRTDTNsiaan3g/KIXXUM1cmQDKQBA7ok3t0iYDwCGJjEcx6+MAvdKQjQbvYmGqc9QSDIaPwpoKFLsjltBgjZQDeB2t97UOYcduIF7eVg2wWdxLDJkLEfwT1OS5qYh9J1BwiulqhJdj7wiFf8A5R6wqKBpjnjSS9a6vcYHh3Mi8M2QoekF6dRZSz6Q==

    
    
  • 1
  • 2

删除本地的SSH-RSA即可

[root@docker tools]# ssh-keygen -R 172.17.0.2
# Host 172.17.0.2 found: line 3
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old
  • 1
  • 2
  • 3
  • 4
  • 5

最后重新SSH连接即可成功

[root@docker tools]# ssh 172.17.0.2
The authenticity of host '172.17.0.2 (172.17.0.2)' can't be established.
RSA key fingerprint is SHA256:egegjw6C/fb8Oy/Ipkt41NBTHhWNVwU1Hq1Jg/tp9q8.
RSA key fingerprint is MD5:73:9b:3e:c3:93:10:d9:17:74:af:ff:a9:67:59:47:80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.17.0.2' (RSA) to the list of known hosts.
root@172.17.0.2's password: 
[root@f02cc1f8d0dd ~]# 

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

除此之外,也可以直接删除rsa

rm -rf /root/.ssh/*

 
 
  • 1
文章知识点与官方知识档案匹配,可进一步学习相关知识
CS入门技能树Linux入门初识Linux 22375 人正在系统学习中
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值