gpt4 book ai didi

linux - git clone 无法通过 HTTP 开始中继

转载 作者:太空狗 更新时间:2023-10-29 12:39:39 24 4
gpt4 key购买 nike

使用 git clone 时,我遇到了一个错误。这是命令和错误信息。

[user@linux]$ git clone git@github.com:username/repertory.git
FATAL: failed to begin relaying via HTTP.
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

除了git@github,git clone https://......和git clone git://......都运行良好。所以我猜想 ssh 协议(protocol)有问题,然后我检查了 ssh。

[user@linux]$ ssh -T git@github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.

看来我可以通过ssh协议(protocol)正常连接到github了。但是通过ssh git clone 有什么问题呢?

最佳答案

此错误信息来自 connect.c from SSH

这是一个SSH Proxy Command -- connect.c ,通过 SOCKS 和 https 代理建立网络连接的简单中继命令:您可以使用此命令在防火墙之外建立 SSH session 。

因此请检查是否需要这样的连接:如果您在企业中,在防火墙后面,则很可能需要它,但在这种情况下,请联系您的 IT 支持团队以检查此类解决方案的有效性/批准。

并且该错误消息表明即使是这种 SSH 模式(通过 https 代理中继)也可能被阻止。

如果您不在企业环境中,并且不需要代理,请从您的环境变量和您的 HTTPS(S)/PROXY 中删除它们 ( git config )文件。

关于linux - git clone 无法通过 HTTP 开始中继,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50426912/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com