Rantiev
Rantiev

Reputation: 2263

github ssh connection setup

I get Permission denied (publickey). on Windows 7 x64

What i did is:

1) Updated my git + openSSH as well

2) generated keys with ssh-keygen -t rsa -b 4096 -C "myemail@gmailcom"

3) named them 'hub', so i have hub + hub.pub in .ssh folder

4) run ssh-agent -s

5) run ssh-agent sh -c 'ssh-add ./hub' it said identity added, i can't run "eval $(ssh-agent -s)" on windows so i found "sh -c" (by the waywhy everyone write only unix like instructions always ( )

6) added my public key into github SSH keys list in my github account

7) ssh -vT [email protected]

Full log:

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).

Why i should to do else?

Upvotes: 0

Views: 421

Answers (2)

Rantiev
Rantiev

Reputation: 2263

Eventually i have figured out, that i had several GIT installed on my computer. One was in Program Files, and the other was in Program Files x64 (old one). Seems old version wasn't removed completely during installation or newer one.

After i had uninstalled both and installed new one it works fine.

Upvotes: 0

Tim
Tim

Reputation: 2381

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

You are trying to connect with (wrong?) keys from these files.
So may this can help you?
I am sure there is a config file like this on Windows?

Upvotes: 1

Related Questions