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

Re: Bug with SSH keys loaded into ssh-add

From
JPJacob Pfundstein <jjpfst@gmail.com>
Date
Nov 24, 2024, 22:41 UTC
Message-ID
<CAFmt1jxxnnhSysC0cLEptifY=cKLZ4rgBJ4gpp1O7=WkuMzeaA@mail.gmail.com>
In-Reply-To
<Z0Oavzr03tTMiKfl@tapette.crustytoothpaste.net>
Hi Brian,

the issue was indeed solved by using the OpenSSH version that comes bundled with Windows instead of the one that ships with Git. Thanks a lot!

Best Regards,
Jacob P.

Am So., 24. Nov. 2024 um 22:29 Uhr schrieb brian m. carlson <sandals@crustytoothpaste.net>:

Show 43 quoted lines
>
> On 2024-11-24 at 16:23:21, Jacob Pfundstein wrote:
> > Hello everyone,
>
> Hi,
>
> > I've recently encountered a bug/issue while using Git for Windows. You
> > can load a passphrase-secured SSH key into the ssh agent using
> > ssh-add. As long as the key is loaded into the ssh agent, you don't
> > have to enter the passphrase when using the key. However, when I do
> > git pull or something similar, Git still prompts me for the
> > passphrase.
>
> This isn't Git prompting you for the passphrase.  Git passes the
> terminal through to OpenSSH, which is prompting you for the passphrase.
> There's really nothing that Git can do, since it doesn't know what
> OpenSSH will do.
>
> I can make a guess about what might be going wrong here so you can try
> to see if that fixes things, and if not, you could try contacting the
> Git for Windows issue tracker at [0].  Please be sure to search first,
> including the closed issues, as the question may already have been asked
> and answered.
>
> My guess as to what's going on is that you're using two different
> versions of OpenSSH, since there are two with Git for Windows.  One is
> shipped with Git for Windows, and one is the one shipped with Windows. I
> think MSYS2 may implement sockets in an unusual way, which means that if
> the agent is from one version and the `ssh` binary is from another
> version, that they may not be able to communicate properly.  In such a
> case, OpenSSH would prompt you again since it can't contact the agent.
> You could try using both from the same version (I think there's an
> install option for that) or try using Git Bash to see if that fixes the
> problem (even if that isn't a good solution for you, it's useful to know
> from a debugging point of view).
>
> As I said, this is just a guess and I don't use Windows, so you'll have
> to try what I mentioned above or open an issue.
>
> [0] https://github.com/git-for-windows/git/issues
> --
> brian m. carlson (they/them or he/him)
> Toronto, Ontario, CA
Previous: brian m. carlson
Message 3 of 3 in “Bug with SSH keys loaded into ssh-add”
  1. Jacob PfundsteinNov 24, 2024
  2. brian m. carlsonNov 24, 2024
  3. Jacob PfundsteinNov 24, 2024

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.