Subject: Key Troubles

Original Post Gotham Gazette's Avatar

Gotham Gazette

10 Aug, 2009 05:33 PM

I use my id_rsa key regularly. For almost everything. So I know the problem isn't my key. However, I can't seem to use my key with Git.

$ git push origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Here's what I get from ssh -v git@github.com

OpenSSH_5.1p1 Debian-5ubuntu1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /home/amanda/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [65.74.177.129] port 22.
debug1: Connection established.
debug1: identity file /home/amanda/.ssh/identity type -1
debug1: identity file /home/amanda/.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/amanda/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2
debug1: match: OpenSSH_5.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-5ubuntu1
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 /home/amanda/.ssh/known_hosts:42
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: /home/amanda/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/amanda/.ssh/identity
debug1: Trying private key: /home/amanda/.ssh/id_dsa
debug1: No more authentication methods to try.

What am I missing here?

  1. 2 Posted by GothamGazette on 10 Aug, 2009 06:02 PM

    GothamGazette's Avatar

    Okay, I figured out how to pull a line out of my known_hosts file with ssh-keygen -R github.com and now ssh works fine:

    $ ssh git@github.com
    PTY allocation request failed on channel 0
    Hi GothamGazette! You've successfully authenticated, but GitHub does not provide shell access.
    Connection to github.com closed.
    

    but I still can't git push orgin master:

    $ git push origin master
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly
    

    IdentityFile ~/.ssh/id_dsa

  2. 3 Posted by GothamGazette on 10 Aug, 2009 09:02 PM

    GothamGazette's Avatar

    Okay. It turns out that in addition to needing to clear out my known_hosts, I had introduced a typo when I set my origin. Luckily, I found instructions about how to change my origin.

    And, I just published my first repository.

  3. Support Staff 4 Posted by Tekkub on 10 Aug, 2009 09:37 PM

    Tekkub's Avatar

    Sorry for the delay, did you get everything worked out? If you have flash enabled, there is a little clipboard icon by the URLs on the repo page you can use to copy the URL with one click, very handy if you type as bad as I do...

    One concern I have though, this line:

    OpenSSH_5.1p1 Debian-5ubuntu1, OpenSSL 0.9.8g 19 Oct 2007
    

    There was an issue with debian/ubuntu some time back that could cause compromised keys. You should make sure your openssh is up to date, and run their key checker if you generated any keys with that version. You can get more info here

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

10 Feb, 2010 02:58 AM
10 Feb, 2010 01:30 AM
10 Feb, 2010 01:22 AM
10 Feb, 2010 01:15 AM
10 Feb, 2010 12:15 AM

 

10 Feb, 2010 12:04 AM
09 Feb, 2010 10:54 PM
09 Feb, 2010 10:44 PM
09 Feb, 2010 09:45 PM
09 Feb, 2010 08:48 PM