【问题标题】:ssh -vT git@github.com kex_exchange_identification: Connection closed by remote hostssh -vT git@github.com kex_exchange_identification:连接被远程主机关闭
【发布时间】:2020-04-28 18:21:05
【问题描述】:

the way I config the ssh-key, 我生成了一个新的ssh密钥,添加到我的github,但是有问题,我尝试了很多方法,但我不能。

$ ssh -vT git@github.com
OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [111.40.234.2] port 22.
debug1: Connection established.
debug1: identity file /c/Users/dell/.ssh/id_rsa type 0
debug1: identity file /c/Users/dell/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_dsa type -1
debug1: identity file /c/Users/dell/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/dell/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/dell/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_xmss type -1
debug1: identity file /c/Users/dell/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
kex_exchange_identification: Connection closed by remote host

我能做什么?

【问题讨论】:

  • 您似乎在使用 Windows 和 Cygwin。这些细节可能应该在您的问题中提及。另外,你的ssh 客户端是如何配置的,你是如何具体告诉它哪个密钥用于 Github?

标签: git github ssh ssh-keys


【解决方案1】:

我怀疑您的 ~/.ssh/ 中的密钥过多。将ssh 指向您使用的确切密钥。在~/.ssh/config

Host github.com
    User git
    HostName github.com
    IdentityFile ~/.ssh/id_rsa # or whatever key you use with Github

然后再试ssh -Tv git@github.com

【讨论】:

  • 我只有一把钥匙,我试试这个方法,还是不行。
【解决方案2】:

如果您只有一个密钥,请尝试使用 the old PEM format 重新生成它,并且没有密码,以进行测试:

ssh-keygen -t rsa -P "" -m PEM

id_rsa.pub 的内容复制到您的 GitHub 个人资料中,然后重试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-25
    • 2019-10-27
    • 1970-01-01
    • 2012-02-03
    • 1970-01-01
    • 1970-01-01
    • 2020-07-05
    • 1970-01-01
    相关资源
    最近更新 更多