* Git SSH Authentication
@ 2012-02-11 4:01 isawk
2012-02-11 5:05 ` Sitaram Chamarty
0 siblings, 1 reply; 4+ messages in thread
From: isawk @ 2012-02-11 4:01 UTC (permalink / raw)
To: git
I'm unable to authenticate with git through ssh public key/password-less
authentication.
# git push origin master
# Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
# fatal: The remote end hung up unexpectedly
git version
git version 1.7.8.4
git user
has .ssh/authorized_keys containing public key, but still nothing. I'm confused
on how to go about fixing this issue.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Git SSH Authentication
2012-02-11 4:01 Git SSH Authentication isawk
@ 2012-02-11 5:05 ` Sitaram Chamarty
2012-02-11 7:54 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Sitaram Chamarty @ 2012-02-11 5:05 UTC (permalink / raw)
To: isawk; +Cc: git
On Sat, Feb 11, 2012 at 9:31 AM, isawk <kwasi.gyasiagyei@4things.co.za> wrote:
> I'm unable to authenticate with git through ssh public key/password-less
> authentication.
>
> # git push origin master
> # Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
> # fatal: The remote end hung up unexpectedly
if it didn't ask you for a password when pubkey access failed, that's
non-default. Someone explicitly told sshd to do that.
Common causes of pubkey access fail:
- wrong pubkey being used: run your ssh with '-vv' and look for
"offered". make sure the pubkey that is being offered has been added
to the server side ~/.ssh/authorized_keys
- wrong pubkey being offered: if you are using ssh-agent, make sure
you have 'ssh-add'ed the key you want to offer. Confirm with 'ssh-add
-l'
- wrong permissions on server side: sshd is very picky about
permissions. Any directory component of $HOME/.ssh having g+w or o+w
will make it refuse. Or wrong ownership (for example if you created a
file using root).
- AllowUsers setting on server side /etc/ssh/ssd_config: this item
is not set by default, which allows everyone to log in. But if
someone set it in for some reason, then the git user must also be
added to it.
In general, looking in server side /var/log/auth.log or
/var/log/secure or some such file will give you more information.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Git SSH Authentication
2012-02-11 5:05 ` Sitaram Chamarty
@ 2012-02-11 7:54 ` Junio C Hamano
2012-02-11 10:23 ` Sitaram Chamarty
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-02-11 7:54 UTC (permalink / raw)
To: Sitaram Chamarty; +Cc: isawk, git
Sitaram Chamarty <sitaramc@gmail.com> writes:
> Common causes of pubkey access fail:
>
> - wrong pubkey being offered: if you are using ssh-agent, make sure
> you have 'ssh-add'ed the key you want to offer. Confirm with 'ssh-add
> -l'
A failure related to this I saw is to have (too) many keys in ssh-agent,
and running ssh without telling it which exact key to use. The client
tries each key in turn and the server rejects the connection attempt after
seeing too many keys tried. "ssh -v" is useful to diagnose this mode of
failure, and an entry in ~/.ssh/config like:
Host example.com
User myusernameoverthere
IdentityFile ~/.ssh/id_rsa-for-example.com
would fix it.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Git SSH Authentication
2012-02-11 7:54 ` Junio C Hamano
@ 2012-02-11 10:23 ` Sitaram Chamarty
0 siblings, 0 replies; 4+ messages in thread
From: Sitaram Chamarty @ 2012-02-11 10:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: isawk, git
On Sat, Feb 11, 2012 at 1:24 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Sitaram Chamarty <sitaramc@gmail.com> writes:
>
>> Common causes of pubkey access fail:
>>
>> - wrong pubkey being offered: if you are using ssh-agent, make sure
>> you have 'ssh-add'ed the key you want to offer. Confirm with 'ssh-add
>> -l'
>
> A failure related to this I saw is to have (too) many keys in ssh-agent,
> and running ssh without telling it which exact key to use. The client
> tries each key in turn and the server rejects the connection attempt after
> seeing too many keys tried. "ssh -v" is useful to diagnose this mode of
> failure, and an entry in ~/.ssh/config like:
>
> Host example.com
> User myusernameoverthere
> IdentityFile ~/.ssh/id_rsa-for-example.com
>
> would fix it.
Interesting... I didn't know this, so I checked man sshd_config
looking for exactly how many keys it would fail after. The setting
seems to be MaxAuthTries, and defaults to 6.
--
Sitaram
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-11 10:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-11 4:01 Git SSH Authentication isawk
2012-02-11 5:05 ` Sitaram Chamarty
2012-02-11 7:54 ` Junio C Hamano
2012-02-11 10:23 ` Sitaram Chamarty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox