SSH连接远程机器报错:Host key verification failed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
C:\Users\xxx>ssh root@10.239.168.39
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
SHA256:Vlrl2MRlgUIabY2IgyP4OUm79938tPNVyhw92wz3Guc.
Please contact your system administrator.
Add correct host key in C:\\Users\\xxx/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\xxx/.ssh/known_hosts:1
RSA host key for 10.239.168.39 has changed and you have requested strict checking.
Host key verification failed.

 

网上查了各种方法,都不太管用

解决方法:

1.主机生成密钥对 ssh-keygen  -t rsa

2.将主机上生成的公钥.pub复制到远程机器~/.ssh/authorized_keys (没有authorized_keys就新建一个,可以通过ssh-copy-id root@remote_ip -p 22复制)

3.修改/etc/ssh/sshd_config  ->  PunlicAuthentication yes; PasswordAuthentication yes

4.重启远程机器

 

posted @   腹肌猿  阅读(96)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示