{"thread":{"id":"29600","subject":"Git SSH Authentication","startedAt":"2012-02-11T04:01:37Z","lastAt":"2012-02-11T10:23:55Z","messageCount":4,"participants":["isawk","Sitaram Chamarty","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"184423","messageId":"loom.20120211T045801-602@post.gmane.org","threadId":"29600","inReplyTo":null,"subject":"Git SSH Authentication","fromName":"isawk","fromEmail":"kwasi.gyasiagyei@4things.co.za","sentAt":"2012-02-11T04:01:37Z","receivedAt":"2012-02-11T04:01:37Z","isPatch":false,"sender":{"key":"kwasi.gyasiagyei@4things.co.za","avatar":null},"body":"I'm unable to authenticate with git through ssh public key/password-less\nauthentication.\n\n# git push origin master\n# Permission denied (publickey,gssapi-keyex,gssapi-with-mic).\n# fatal: The remote end hung up unexpectedly\n\ngit version\n\ngit version 1.7.8.4\n\ngit user\n\nhas .ssh/authorized_keys containing public key, but still nothing. I'm confused\non how to go about fixing this issue.\n"},{"id":"184425","messageId":"CAMK1S_jmY5KvBH8z6YKszroMai4O5ULeCBYGAGFT4CgVUAfmwg@mail.gmail.com","threadId":"29600","inReplyTo":"loom.20120211T045801-602@post.gmane.org","subject":"Re: Git SSH Authentication","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-02-11T05:05:42Z","receivedAt":"2012-02-11T05:05:42Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Sat, Feb 11, 2012 at 9:31 AM, isawk <kwasi.gyasiagyei@4things.co.za> wrote:\n> I'm unable to authenticate with git through ssh public key/password-less\n> authentication.\n>\n> # git push origin master\n> # Permission denied (publickey,gssapi-keyex,gssapi-with-mic).\n> # fatal: The remote end hung up unexpectedly\n\nif it didn't ask you for a password when pubkey access failed, that's\nnon-default.  Someone explicitly told sshd to do that.\n\nCommon causes of pubkey access fail:\n\n  - wrong pubkey being used: run your ssh with '-vv' and look for\n\"offered\".  make sure the pubkey that is being offered has been added\nto the server side ~/.ssh/authorized_keys\n  - wrong pubkey being offered: if you are using ssh-agent, make sure\nyou have 'ssh-add'ed the key you want to offer.  Confirm with 'ssh-add\n-l'\n  - wrong permissions on server side: sshd is very picky about\npermissions.  Any directory component of $HOME/.ssh having g+w or o+w\nwill make it refuse.  Or wrong ownership (for example if you created a\nfile using root).\n  - AllowUsers setting on server side /etc/ssh/ssd_config: this item\nis not set by default, which allows everyone to log in.  But if\nsomeone set it in for some reason, then the git user must also be\nadded to it.\n\nIn general, looking in server side /var/log/auth.log or\n/var/log/secure or some such file will give you more information.\n"},{"id":"184441","messageId":"7vty2xn6tl.fsf@alter.siamese.dyndns.org","threadId":"29600","inReplyTo":"CAMK1S_jmY5KvBH8z6YKszroMai4O5ULeCBYGAGFT4CgVUAfmwg@mail.gmail.com","subject":"Re: Git SSH Authentication","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-11T07:54:30Z","receivedAt":"2012-02-11T07:54:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n> Common causes of pubkey access fail:\n>\n>   - wrong pubkey being offered: if you are using ssh-agent, make sure\n> you have 'ssh-add'ed the key you want to offer.  Confirm with 'ssh-add\n> -l'\n\nA failure related to this I saw is to have (too) many keys in ssh-agent,\nand running ssh without telling it which exact key to use.  The client\ntries each key in turn and the server rejects the connection attempt after\nseeing too many keys tried.  \"ssh -v\" is useful to diagnose this mode of\nfailure, and an entry in ~/.ssh/config like:\n\n    Host example.com\n\tUser myusernameoverthere\n        IdentityFile ~/.ssh/id_rsa-for-example.com\n\nwould fix it.\n"},{"id":"184449","messageId":"CAMK1S_hxUDx8M+JpiDguUETkUhfQzmpHj-s6++BXrknGRMR7vg@mail.gmail.com","threadId":"29600","inReplyTo":"7vty2xn6tl.fsf@alter.siamese.dyndns.org","subject":"Re: Git SSH Authentication","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-02-11T10:23:55Z","receivedAt":"2012-02-11T10:23:55Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Sat, Feb 11, 2012 at 1:24 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Sitaram Chamarty <sitaramc@gmail.com> writes:\n>\n>> Common causes of pubkey access fail:\n>>\n>>   - wrong pubkey being offered: if you are using ssh-agent, make sure\n>> you have 'ssh-add'ed the key you want to offer.  Confirm with 'ssh-add\n>> -l'\n>\n> A failure related to this I saw is to have (too) many keys in ssh-agent,\n> and running ssh without telling it which exact key to use.  The client\n> tries each key in turn and the server rejects the connection attempt after\n> seeing too many keys tried.  \"ssh -v\" is useful to diagnose this mode of\n> failure, and an entry in ~/.ssh/config like:\n>\n>    Host example.com\n>        User myusernameoverthere\n>        IdentityFile ~/.ssh/id_rsa-for-example.com\n>\n> would fix it.\n\nInteresting... I didn't know this, so I checked man sshd_config\nlooking for exactly how many keys it would fail after.  The setting\nseems to be MaxAuthTries, and defaults to 6.\n\n-- \nSitaram\n"}]}