清除原有SSH公钥

清除原有SSH公钥
Linux清除原有ssh密钥方法

1.问题现象
Cygwin用ssh远程连接到Linux服务器,连接的时候老是提示如下错误:

$ ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:sEW0wX/qpQ6hgIGDprYDWV9FI7BaC2HZ6Bu+rgfnsYps.
Please contact your system administrator.
Add correct host key in /home/csjpli/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/csjpli/.ssh/known_hosts:11
ECDSA host key for [159.11.22.111]:38002 has changed and you have requested strict checking.
Host key verification failed.

只要清除老的公钥信息就可以了。

2.尝试方法
尝试了如下的方法, 并无效果:
ssh-keygen -R 159.11.22.111(你远程服务器的IP)
参考: 博文

3. 解决问题的方法:

进入到~/.ssh/known_hosts 文件,把服务器地址为159.11.22.111的公钥直接删了,即可。

你可能感兴趣的:(常见问题Linux,linux,ssh)