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

Re: Git SSH Authentication

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 11, 2012, 07:54 UTC
Message-ID
<7vty2xn6tl.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAMK1S_jmY5KvBH8z6YKszroMai4O5ULeCBYGAGFT4CgVUAfmwg@mail.gmail.com>
Sitaram Chamarty <sitaramc@gmail.com> writes:
Show 5 quoted lines
> 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.
Previous: Sitaram ChamartyNext: Sitaram Chamarty
Message 3 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.