github ssh连接设置

时间:2015-09-20 20:30:06

标签: github ssh

我获得Permission denied(publickey)。在Windows 7 x64上

我做的是:

1)更新了我的git + openSSH

2)使用ssh-keygen生成密钥-t rsa -b 4096 -C“myemail @ gmailcom”

3)将它们命名为“hub”,所以我在.ssh文件夹中有hub + hub.pub

4)运行ssh-agent -s

5)运行ssh-agent sh -c'ssh-add ./hub' 它说身份添加了,我无法在Windows上运行“eval $(ssh-agent -s)”,所以我找到了“sh -c”(顺便说一句,为什么每个人都只写unix像指令一样)(

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

7)ssh -vT git@github.com

完整日志:

C:\Users\ra\.ssh>ssh -vT git@github.com
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 个答案:

答案 0 :(得分:1)

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

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