从终端克隆一个仓库:
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.
我已经按照生成并添加SSH密钥的步骤进行操作,但是当我测试SSH连接时,出现了相同的结果:
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 克隆存储库,但在此之后,我无法执行其他操作(检出/推送...)。
有什么建议可能会导致这种情况或如何修复它?
ssh -v
来获得更详细的输出。附注:你可以在问题中更新详细输出内容。 - YesThatIsMyName