在Windows 7上配置GitBash:ssh失败,我正在尝试一切,疯了 [英] Configuring GitBash on Windows 7: ssh failing, I'm trying everything, going nuts

查看:207
本文介绍了在Windows 7上配置GitBash:ssh失败,我正在尝试一切,疯了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在Windows 7上。



对Murgatroyd诚实我一直在扫描谷歌和论坛整天关于这个没有突破。



在我最近的尝试中,我把配置文件放在C: \Users\myname.ssh。结果有点接近快乐,但仍然没有。



我的配置只是说:

 主机github.com 
IdentityFile〜/ .ssh / id_rsa

命令 ssh -vT git@github.com 产生:

  OpenSSH_4.6p1,OpenSSL 0.9.8e 2007年2月23日
debug1:读取配置数据/c/Users/myname/.ssh/config
debug1:为github.com申请选项
debug1:连接到github.com [192.30.252.130]端口22.
debug1:建立连接。
debug1:身份文件/c/Users/myname/.ssh/id_rsa类型1
debug1:远程协议版本2.0,远程软件版本OpenSSH_5.9p1 Debian-5ubuntu1 + github5
debug1:匹配:OpenSSH_5.9p1 Debian-5ubuntu1 + github5 pat OpenSSH *
debug1:为协议2.0启用兼容模式
debug1:本地版本字符串SSH-2.0-OpenSSH_4.6
debug1:SSH2_MSG_KEXINIT发送
debug1:SSH2_MSG_KEXINIT收到
debug1:kex:server->客户端aes128 -cbc hmac-md5无
debug1:kex:客户端 - >服务器aes128 -cbc hmac-md5无
调试1:SSH2_MSG_KEX_DH_GEX_REQUEST(1024 <1024 <8192)发送
调试1:期望SSH2_MSG_KEX_DH_GEX_GROUP
调试1:SSH2_MSG_KEX_DH_GEX_INIT发送
调试1:期望SSH2_MSG_KEX_DH_GEX_REPLY
调试1:主机'github.com'匹配RSA主机密钥。
debug1:找到密钥在/c/Users/myname/.ssh/known_hosts:2
debug1:ssh_rsa_verify:签名正确
debug1:SSH2_MSG_NEWKEYS发送
debug1:期待SSH2_MSG_NEWKEYS
debug1:SSH2_MSG_NEWKEYS收到
debug1:SSH2_MSG_SERVICE_REQUEST发送
debug1:收到SSH2_MSG_SERVICE_ACCEPT
debug1:可继续的身份验证:publickey
debug1:下一个验证方法:publickey
debug1 :提供公钥:/c/Users/myname/.ssh/id_rsa
debug1:可以继续的身份验证:publickey
debug1:不需要更多身份验证方法来尝试。
权限被拒绝(publickey)。

输出的顶部看起来像我的钥匙被找到并使用,底部像是它't。



我很困惑。



任何建议都会深表谢意。



感谢您的阅读。

解决方案

事实证明 - 非常奇怪 - 在Windows 7下,ssh-keygen不会每次生成好的可用密钥对。



我重复了generate-upload-then-test循环几次 - out纯粹的绝望 - 这个问题本身就消失了。



非常奇怪。


I'm going nuts just trying to ssh to github.

I'm on windows 7.

Honest to Murgatroyd I've been scanning google and forums all day about this without breaking through.

In my latest attempt I've put a config file in C:\Users\myname.ssh. The results are a bit closer to happiness but still not there.

my config simply says:

Host github.com
    IdentityFile ~/.ssh/id_rsa

The command ssh -vT git@github.com produces:

OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Users/myname/.ssh/config
debug1: Applying options for github.com
debug1: Connecting to github.com [192.30.252.130] port 22.
debug1: Connection established.
debug1: identity file /c/Users/myname/.ssh/id_rsa type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1+github5
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1+github5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/myname/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /c/Users/myname/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

The top of the output looks like my key is being found and used, and the bottom like it isn't.

I'm pretty baffled.

ANY advice would be deeply appreciated.

Thanks for reading.

解决方案

It turns out -- very weirdly -- that ssh-keygen, under Windows 7, does NOT generate good usable key pairs every time.

I repeated the generate-upload-then-test cycle a few times -- out of sheer desperation -- and the problem simply went away by itself.

Very weird.

这篇关于在Windows 7上配置GitBash:ssh失败,我正在尝试一切,疯了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆