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 git#github.com
Full log:
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).
Why i should to do else?
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?
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.
Related
I cannot ssh into github no matter what I do. All attempts appear to decline my key pair. I am able to ssh into my home server just fine, so I assume that this issue is with github specifically.
This is what I've tried so far. All of these methods fail with the same issue:
I have tried logging in using the key produced by my script below as a deploy key in github
I have tried using a similar set of steps as that script and instead added the key to the list of my account SSH Keys
I have tried using different algorithms (ecdsa, ed25519, rsa, etc...)
I have tried logging in via my own machine (linux mint) and my home server (ubuntu)
I have tried adding the key to the ssh-agent using ssh-add
I checked the SHA256 fingerprint in github for the key against the output of ssh -v below and it matches
Local Machine
This is my ~/.ssh/config:
Host github.com
User git
HostName github.com
IdentityFile ~/.ssh/github_ecdsa
Here, I have output from running ssh -vT git#github.com
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/[REDACTED]/.ssh/config
debug1: /home/[REDACTED]/.ssh/config line 1: Applying options for github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to github.com [140.82.113.3] port 22.
debug1: Connection established.
debug1: identity file /home/[REDACTED]/.ssh/github_ecdsa type 2
debug1: identity file /home/[REDACTED]/.ssh/github_ecdsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.1
debug1: compat_banner: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to github.com:22 as 'git'
debug1: load_hostkeys: fopen /home/[REDACTED]/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305#openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305#openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:5ip0RVW9UxjapS8EiRiO6d9k+SJArVU0NVXDSHjTAVU
debug1: load_hostkeys: fopen /home/[REDACTED]/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'github.com' is known and matches the ED25519 host key.
debug1: Found key in /home/[REDACTED]/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: get_agent_identities: ssh_get_authentication_socket: Connection refused
debug1: Will attempt key: /home/[REDACTED]/.ssh/github_ecdsa ECDSA SHA256:[REDACTED] explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519#openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256#openssh.com,webauthn-sk-ecdsa-sha2-nistp256#openssh.com>
debug1: kex_input_ext_info: publickey-hostbound#openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/[REDACTED]/.ssh/github_ecdsa ECDSA SHA256:[REDACTED] explicit
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
git#github.com's password:
I can see that, near the bottom, it offered the key I configured, but because it moved right on to password authentication, I am assuming it declined my key.
My Home Server
I have the following script:
#!/bin/bash
# generate a key pair
repo=$1
ssh-keygen -t ed25519 -N "" -f .deploy-keys/$repo >/dev/null
# give time to add the public key to github
cat .deploy-keys/$repo.pub
read
# clone using an ssh command that has the identity file set to the private key
git -c core.sshCommand="ssh -vi .deploy-keys/$repo" clone git#github.com:username/$repo
At the read step, I'll do the following:
copy the contents of the public key.
go to https://github.com/username/repo/settings/keys/new
paste the contents into the big box, give it a name, and save
press enter to continue on the script
The verbose output for this one is here (I truncated most of it this time):
...
debug1: kex_input_ext_info: publickey-hostbound#openssh.com=<0>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: .deploy-keys/[REDACTED] ED25519 SHA256:[REDACTED] explicit
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
git#github.com's password:
Again, I can see that it found my key. What gives? I've never had the problem in the past. I've used Windows, MacOS, and Linux machines for this before, but never has this issue been so persistent.
UPDATE
I deleted my known_hosts file, and then added the github fingerprints from the link provided by Chris.C to be safe. I noticed that when I ssh to my home server, I see this fingerprint:
ED25519 key fingerprint is SHA256:5ip0RVW9UxjapS8EiRiO6d9k+SJArVU0NVXDSHjTAVU.
And then when I try to ssh to git#github.com, it shows me an error with the same fingerprint:
The fingerprint for the ED25519 key sent by the remote host is
SHA256:5ip0RVW9UxjapS8EiRiO6d9k+SJArVU0NVXDSHjTAVU.
It appears that my router loopback masquerading is somehow messed up. I confirmed that this fingerprint is the actual one for my home server, and it looks like my router is sending all ssh requests to that server instead of outside the network. Funny thing is, I have similar rules defined for 80 and 443, but those two ports do not experience the same issues. Odd behavior, but my problem is out of scope now for the question I originally asked. Thanks for the help!
Your log shows
debug1: Server host key: ssh-ed25519 SHA256:5ip0RVW9UxjapS8EiRiO6d9k+SJArVU0NVXDSHjTAVU
However github should have below fingerprints.
SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU (Ed25519)
So you're connecting to the wrong github server...
If I run ssh-add -l I see my identity in the list as expected. If I run ssh -vT git#github.com I get this output:
OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/myself/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to github.com [140.82.113.4] port 22.
debug1: Connection established.
debug1: identity file /Users/myself/.ssh/id_rsa type -1
debug1: identity file /Users/myself/.ssh/id_rsa-cert type -1
debug1: identity file /Users/myself/.ssh/id_dsa type -1
debug1: identity file /Users/myself/.ssh/id_dsa-cert type -1
debug1: identity file /Users/myself/.ssh/id_ecdsa type -1
debug1: identity file /Users/myself/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/myself/.ssh/id_ed25519 type -1
debug1: identity file /Users/myself/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/myself/.ssh/id_xmss type -1
debug1: identity file /Users/myself/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
debug1: Remote protocol version 2.0, remote software version babeld-849b9b5f
debug1: no match: babeld-849b9b5f
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305#openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305#openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /Users/myself/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: Generated by Sourcetree on macOS for myself-GitHub RSA SHA256:WnUQPEasG3tUVyEkE7Ufo9fGoRqCdUeY9ohZ7OU6fsc agent
debug1: Will attempt key: /Users/myself/.ssh/id_rsa
debug1: Will attempt key: /Users/myself/.ssh/id_dsa
debug1: Will attempt key: /Users/myself/.ssh/id_ecdsa
debug1: Will attempt key: /Users/myself/.ssh/id_ed25519
debug1: Will attempt key: /Users/myself/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: Generated by Sourcetree on macOS for myself-GitHub RSA SHA256:WnUQPEasG3tUVyEkE7Ufo9fGoRqCdUeY9ohZ7OU6fsc agent
debug1: Server accepts key: Generated by Sourcetree on macOS for myself-GitHub RSA SHA256:WnUQPEasG3tUVyEkE7Ufo9fGoRqCdUeY9ohZ7OU6fsc agent
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([140.82.113.4]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_TERMINAL_VERSION = 3.3.8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_TERMINAL = iTerm2
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi myself! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3564, received 2484 bytes, in 0.2 seconds
Bytes per second: sent 18846.5, received 13135.4
debug1: Exit status 1
I still can't push code to github despite getting the You've successfully authenticated message in this debug output, the SSH identity being generated by SourceTree itself, and ensuring my SSH Agent is running by doing eval "$(ssh-agent)".
I can also see the expected key in my github profile.
What is wrong here?
my SSH Agent is running by doing eval "$(ssh-agent)".
This is likely the problem. ssh knows to talk to ssh-agent via the SSH_AUTH_SOCK environment variables. Environment variables are only visible to a process and its children.
eval "$(ssh-agent)" sets SSH_AUTH_SOCK for this shell and its children only; that is anything you ran from that shell. If you then run git in this shell it should work. But if you have some stand alone program not launched from this shell, like Atlassian Sourcetree, when it runs ssh it will not know to talk to that ssh-agent.
You could launch Sourcetree from that shell, but that's not a very good solution.
To fix this, and a host of other ssh related problems, start your ssh-agent at login. This should be done for you by your operating system, or if not follow the instructions for your operating system. Otherwise, follow the advice in the various answers here.
i am sure i upload my ssh key to github, and i also give the folder and file right permition. but i still got this. anyidea?
➜ python-google ssh -vT github.com
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [0.0.62.138] port 22.
debug1: Connection established.
debug1: identity file /Users/seeker/.ssh/id_rsa type 1
debug1: identity file /Users/seeker/.ssh/id_rsa-cert type -1
debug1: identity file /Users/seeker/.ssh/id_dsa type -1
debug1: identity file /Users/seeker/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze1+github8
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1+github8 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr 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 /Users/seeker/.ssh/known_hosts:1
Warning: Permanently added the RSA host key for IP address '0.0.62.138' to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
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 RSA public key: /Users/seeker/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/seeker/.ssh/id_dsa
debug1: No more authentication methods to try.
i am sure i upload my ssh key to github, and i also give the folder and file right permition.
but i still got this. anyidea?
Check if your ssh public key has been copied as one line: It is easy to copy it in multiple lines in the GitHub ssh field.
If is only if your public key is correctly copied and imported on GitHub that /Users/seeker/.ssh/id_rsa(.pub) will work (if your ssh directory is properly protected).
Connecting to github.com [0.0.62.138] port 22.
The GitHub page clearly mentions:
# debug1: Reading configuration data /Users/you/.ssh/config
# debug1: Reading configuration data /etc/ssh_config
# debug1: Applying options for *
# debug1: Connecting to github.com [207.97.227.239] port 22.
The connection should be to 207.97.227.239 on port 22, unless you're overriding settings to use SSH over HTTPS.
Plus make sure you are using / declaring the git user in your config file.
Remove your ~/.ssh/config file, and try a:
ssh -vT git#github.com
You haven't specified which user you'd like to authenticate as. When authenticating to GitHub, the user should always be git — not your individual username.
Try ssh -vT git#github.com .
Please note that GitHub does not provide shell access.
You need to update your puplic key on github so that you can push. Please follow steps:
you an test your key/ssh connection as mentioned here
I know the question has been asked several times.
From my local machine I try to upload files to my repository:
:~/Git-JeanPat/pyFISH$ git push -u origin master
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
my repository is
https://github.com/jeanpat/pyFISH
I check my password from the admin interface of github.
I made a new ssh key from command line, and I copy it on github.
When I check my connection as indicated. it fails:
~/Git-JeanPat/pyFISH$ ssh -vT git#github.com
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /home/simon/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/simon/.ssh/id_rsa-cert type -1
debug1: identity file /home/simon/.ssh/id_dsa type -1
debug1: identity file /home/simon/.ssh/id_dsa-cert type -1
debug1: identity file /home/simon/.ssh/id_ecdsa type -1
debug1: identity file /home/simon/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr 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: Server host key: RSA 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/simon/.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: Roaming not allowed by server
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 RSA public key: /home/simon/.ssh/id_rsa
debug1: Remote: Forced command: gerve jeanpat 95:e1:bb:60:b5:31:63:39:3a:99:d1:01:22:87:3c:15
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 279
Agent admitted failure to sign using the key.
debug1: Trying private key: /home/simon/.ssh/id_dsa
debug1: Trying private key: /home/simon/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).
thanks for your help
I reboot my ubuntu 12.04 laptop and everything went fine ...
Update
Ran into this again today - when my work laptop was taken home - appears that a Window domain might be the underlying issue. Found the solution here:
SSH is looking in the wrong place for the public/private key pair on Windows
Original Question
I've had Git working fine for the last few months, this morning I try and make a push and I'm asked to confirm RSA cert for the IP - I double check github IP and it's ok so I add the certificate. But I'm getting:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
When I try to push or pull.
I read Git - Permission denied (publickey) and tried adding my key again to Github but I'm told:
Key is already in use
Running
ssh -vT git#github.com
Retuns:
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /p/.ssh/identity type -1
debug1: identity file /p/.ssh/id_rsa type -1
debug1: identity file /p/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debia
n-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 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 /p/.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: /p/.ssh/identity
debug1: Trying private key: /p/.ssh/id_rsa
debug1: Trying private key: /p/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
Can anyone point me in the right direction?
Seems like you have a bunch of private keys:
debug1: Trying private key: /p/.ssh/identity
debug1: Trying private key: /p/.ssh/id_rsa
debug1: Trying private key: /p/.ssh/id_dsa
Do you recognize any of these?
You might try to specify the key to be used with -i:
ssh -i /path/to/key -vT git#github.com
Maybe this will help.
I ran into this same issue today. My private key wasn't owned by the account I was logged in with.
For anyone else make sure that your account is the owner of the key. In my case it wasn't as it was copied from another account.
Running ssh -i /path/to/key -vT git#github.com as noted by #lum showed me that I didn't have permission to access my private key. Changing owner on the key fixed my issue.
debug1: could not open key file '/home/matt/.ssh/id_rsa': Permission denied
Hope this helps future people.
copy .ssh folder of C:\Users{Administrator}.ssh to git's working directory