ssh无法连接 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

今天使用git上传代码时,发现不能ssh链接。终端信息如下

192:.ssh ******$ ssh -T git@git.****.cn
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for git.****.cn has changed,
and the key for the corresponding IP address 106.75.12.41
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:3DFkMLXqjf4eRLOaySyOfODBGv+1n+LjShGA2O8Hvrg.
Please contact your system administrator.
Add correct host key in /Users/weizhongming/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/weizhongming/.ssh/known_hosts:17
ECDSA host key for git.pecoo.cn has changed and you have requested strict checking.
Host key verification failed.

解决办法

就是吧~/.ssh/known_hosts里面的关于这个公钥或者git地址的哪行删掉。也就是ssh重新验证

打开.ssh目录
$ cd .ssh
$ open ./
ssh无法连接 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!_第1张图片
WechatIMG100.jpeg

修改完成后验证

$ ssh -T git@git的服务器地址

提示是否重新链接,输入yes

The authenticity of host 'git.pecoo.cn (106.75.12.41)' can't be established.
ECDSA key fingerprint is SHA256:3DFkMLXqjf4eRLOaySyOfODBGv+1n+LjShGA2O8Hvrg.
Are you sure you want to continue connecting (yes/no)? yes

连接成功

Welcome to GitLab, Houhanglei!

你可能感兴趣的:(ssh无法连接 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!)