无法“git pull"- 主机密钥验证失败 [英] Not able to "git pull" - Host key verification failed

查看:103
本文介绍了无法“git pull"- 主机密钥验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对我们的生产服务器具有 root 访问权限,我想将 git 中的最新版本部署到服务器,但是当我在要更新的文件夹上git pull"时遇到以下错误.

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

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

我在 Linux 方面不是很有经验,所以请帮助我明确回答如何修复 :-)

否则我可以访问我需要的任何东西

附言这在过去有效,所以我假设它与 SSH 密钥有关

错误:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@警告:检测到可能的 DNS 欺骗!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@www.site.org 的 ECDSA 主机密钥已更改,以及对应 IP 地址 x.x.x.x 的密钥是未知的.这可能意味着DNS SPOOFING 正在发生或主机的 IP 地址并且它的主机密钥同时发生了变化.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@警告:远程主机标识已更改!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@可能有人在做一些讨厌的事情!有人现在可能正在窃听您(中间​​人攻击)!主机密钥也可能刚刚更改.远程主机发送的 ECDSA 密钥的指纹是*************请联系您的系统管理员.在/root/.ssh/known_hosts 中添加正确的主机密钥以消除此消息./root/.ssh/known_hosts:1 中的违规 ECDSA 密钥删除: ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.orggitlab.site.org 的 ECDSA 主机密钥已更改,您已要求严格检查.主机密钥验证失败.

解决方案

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

<上一页>(...)请联系您的系统管理员.在/root/.ssh/known_hosts 中添加正确的主机密钥以消除此消息./root/.ssh/known_hosts:1 中的违规 ECDSA 密钥删除:ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.orggitlab.site.org 的 ECDSA 主机密钥已更改,您已要求严格检查.主机密钥验证失败.

所以这是执行那里建议的命令的问题:

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

I've got root access to our production server and I want to deploy the latest version in git to the server but I'm running into the error below when I "git pull" on the folder I want to update.

I've browsed around a bit, but can't find a clear answer on what to do..

The staging server runs on the same machine, but just in a different folder and when I pull on that folder it all goes fine.

I'm not very experienced when it comes to Linux, so please help me out with a clear answer on how to fix :-)

Otherwise I have access to anything I need

p.s. This has worked in the past, so I'm assuming it's got something to do with the SSH key

Error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       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.

解决方案

In the log you see the following text:

(...)

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.

So it is a matter of performing the command that is suggested there:

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

这篇关于无法“git pull"- 主机密钥验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆