gpt4 book ai didi

git - 为什么我在 git 上得到 ssh_exchange_identification : Connection closed by remote host?

转载 作者:行者123 更新时间:2023-12-02 13:47:47 42 4
gpt4 key购买 nike

从终端克隆一个 repo:

git clone git@github.foohost.com:barrepo.git
Cloning into 'foorepo'...
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.

我已按照 generating and adding the SSH key 上的步骤操作但当 I test my SSH connection我有相同的结果:

ssh -T git@github.foohost.com:
ssh_exchange_identification: Connection closed by remote host

使用冗长的

ssh -v git@github.foohost.com
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/Fred/.ssh/config
debug1: /Users/Fred/.ssh/config line 18: Applying options for *
debug1: /Users/Fred/.ssh/config line 27: Applying options for github.foohost.com
debug1: /Users/Fred/.ssh/config line 41: Applying options for *.foohost.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Executing proxy command: exec ssh -q b.snc1 nc github 22
debug1: identity file /Users/Fred/.ssh/baz_rsa type 0
debug1: identity file /Users/Fred/.ssh/baz_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: Connection closed by remote host

我可以使用 https 克隆存储库,但之后我无法执行其他操作( checkout/推送...)。

任何可能导致此问题或如何解决的建议?

最佳答案

在我的例子中,这是由于缺少 VPN 连接。

此外,@YesThatIsMyName 评论道:

You may try the steps from this website, like ssh -v for more verboseoutput. P.S. You may update your question with the verbose output. –

关于git - 为什么我在 git 上得到 ssh_exchange_identification : Connection closed by remote host?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58480820/

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