2015-09-20 40 views
0

我得到权限被拒绝(publickey)。在Windows 7 X64的github ssh连接设置

我所做的是:

1)更新我的git +采用openSSH以及

2)生成的密钥使用ssh-凯基-t RSA -b 4096 -C“myemail @ gmailcom “

3)将它们命名为 '中心',所以我有毂+ hub.pub中的.ssh夹

4)运行的ssh-agent -s

5)运行的ssh-agent SH -c 'ssh-add ./hub' 它说的身份加入,我不能在Windows上运行“的eval $(SSH代理-S)”,所以我找到了“SH -c”(由waywhy大家只写类似Unix的指令总是()

6 )加入我的公钥到GitHub的SSH密钥列表中我的github帐户

7)SSH -vT [email protected]

完整的日志:

C:\Users\ra\.ssh>ssh -vT [email protected] 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 
debug1: Connecting to github.com [192.30.252.131] port 22. 
debug1: Connection established. 
debug1: identity file /.ssh/identity type -1 
debug1: identity file /.ssh/id_rsa type -1 
debug1: identity file /.ssh/id_dsa type -1 
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0 
debug1: no match: libssh-0.7.0 
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-sha1 none 
debug1: kex: client->server aes128-cbc hmac-sha1 none 
debug1: sending SSH2_MSG_KEXDH_INIT 
debug1: expecting SSH2_MSG_KEXDH_REPLY 
debug1: Host 'github.com' is known and matches the RSA host key. 
debug1: Found key in /.ssh/known_hosts:1 
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: Trying private key: /.ssh/identity 
debug1: Trying private key: /.ssh/id_rsa 
debug1: Trying private key: /.ssh/id_dsa 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

我为什么还要做别的吗?

回答

1
debug1: Trying private key: /.ssh/identity 
debug1: Trying private key: /.ssh/id_rsa 
debug1: Trying private key: /.ssh/id_dsa 

您正试图从这些文件中连接(错误?)键。
那么可能this可以帮到你吗?
我确定在Windows上有这样的配置文件?

+0

复制具有id_rsa名称的键,结果相同。 .ssh文件夹中没有任何配置文件。 – Rantiev

+0

不,不在您的.ssh文件夹中。只有你的ssh密钥。在windows上从github搜索配置文件。并再次将id_rsa文件添加到ssh-agent? – Tim

+0

是的,添加了id_rsa usina sh -c'ssh-add id_rsa',好的,谢谢你会发现配置。 – Rantiev

0

最终我想通了,我的电脑上安装了几个GIT。一个在Program Files中,另一个在Program Files x64(旧的)中。似乎旧版本在安装期间并未完全删除,或者更新版本。

我已经卸载并安装了新的,它工作正常。