小编典典

无法“ git pull”-主机密钥验证失败

linux

我具有对生产服务器的超级用户访问权限,我想在git中将最新版本部署到服务器,但是当我在要更新的文件夹上“ git pull”时遇到以下错误。

我浏览了一下,但是找不到明确的答案。

登台服务器在同一台计算机上运行,​​但是只是在不同的文件夹中,当我pull在该文件夹中时,一切正常。

我对Linux不太有经验,所以请提供有关如何修复的明确答案:-)

否则我可以使用任何我需要的东西

ps这在过去一直有效,所以我假设它与SSH密钥有关

错误:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for www.site.org has changed,
and the key for the corresponding IP address x.x.x.x
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
*************
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:1
  remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.org
ECDSA host key for gitlab.site.org has changed and you have requested strict checking.
Host key verification failed.

阅读 620

收藏
2020-06-07

共1个答案

小编典典

在日志中,您会看到以下文本:

(...)

请与系统管理员联系。
在/root/.ssh/known_hosts中添加正确的主机密钥以摆脱此消息。
/root/.ssh/known_hosts中有害的ECDSA密钥:1
**使用以下命令删除:ssh-keygen -f“ /root/.ssh/known_hosts” -R gitlab.site.org**
gitlab.site.org的ECDSA主机密钥已更改,您已请求严格检查。
主机密钥验证失败。

因此,只需执行此处建议的命令即可:

ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.org
2020-06-07