git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git SSH Authentication

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Feb 11, 2012, 05:05 UTC
Message-ID
<CAMK1S_jmY5KvBH8z6YKszroMai4O5ULeCBYGAGFT4CgVUAfmwg@mail.gmail.com>
In-Reply-To
<loom.20120211T045801-602@post.gmane.org>
On Sat, Feb 11, 2012 at 9:31 AM, isawk <kwasi.gyasiagyei@4things.co.za> wrote:
Show 6 quoted lines
> 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.

Previous: isawkNext: Junio C Hamano
Message 2 of 4 in “Git SSH Authentication”
  1. isawkFeb 11, 2012
  2. Sitaram ChamartyFeb 11, 2012
  3. Junio C HamanoFeb 11, 2012
  4. Sitaram ChamartyFeb 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.