git - ssh_exchange_identification : Connection closed by remote host under Git bash

标签 git ssh

<分区>

我在 win7 上工作,并使用 sshd 设置 git 服务器。 我 git --bare init myapp.git,并在 Cywgin 中克隆 ssh://git@localhost/home/git/myapp.git正确。但是我又需要配置 Cygwin 的 git,我想在 Git Bash 中克隆 git。我运行 git clone ssh://git@localhost/home/git/myapp.git 并得到以下消息

ssh_exchange_identification: Connection closed by remote host

然后我在 Git Bash 中运行 ssh -vvv git@localhost 并获取消息

debug2: ssh_connect: needpriv 0
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /c/Users/MoreFreeze/.ssh/identity type -1
debug3: Not a RSA1 key file /c/Users/MoreFreeze/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace 
// above it repeats 24 times
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /c/Users/MoreFreeze/.ssh/id_rsa type 1
debug1: identity file /c/Users/MoreFreeze/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host

我的私钥格式似乎有误?而且我发现私钥中正好有25行没有BEGINEND。 我很困惑为什么它说的不是 RSA1 key ,我完全确定它是 RSA 2 key 。

欢迎任何建议。 顺便说一句,我已经在谷歌上阅读了前 3 页关于这个问题的内容。

最佳答案

我今天遇到了这个问题,我意识到我连接到 2 个不同的网络(LAN 和 WLAN),我解决了这个问题只是从我的以太网适配器断开电缆。我想问题是因为 ssh key 与我的无线适配器的 MAC 地址相关联。希望对您有所帮助。

关于git - ssh_exchange_identification : Connection closed by remote host under Git bash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10127818/

相关文章:

git - 多设备混合应用程序安装错误

git - 无法安装git flow

php - 为什么 PHP 的 ssh2_auth_pubkey_file 需要公钥?

file - 如何将文件从SSH远程主机复制到Jenkins服务器

security - 有什么方法可以保证 git 用户在提交和推送时不使用虚假帐户信息?

git - Travis 错误存储库无法从远程存储库中读取

git - 使用 git 将我的 node.js 应用程序部署到我的生产服务器

bash - 简单的 bash 脚本按名称计算正在运行的进程

git - git pull 密码错误 - 重新提示密码?

Git hook 和 ssh 代理转发