{"thread":{"id":"62533","subject":"Bug with SSH keys loaded into ssh-add","startedAt":"2024-11-24T16:23:38Z","lastAt":"2024-11-24T22:41:34Z","messageCount":3,"participants":["Jacob Pfundstein","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"507979","messageId":"CAFmt1jx9OHDnNRdcgB+sPNH90=eZYFRVEbO7PcETiN0ojMQi4Q@mail.gmail.com","threadId":"62533","inReplyTo":null,"subject":"Bug with SSH keys loaded into ssh-add","fromName":"Jacob Pfundstein","fromEmail":"jjpfst@gmail.com","sentAt":"2024-11-24T16:23:21Z","receivedAt":"2024-11-24T16:23:38Z","isPatch":false,"sender":{"key":"jjpfst@gmail.com","avatar":null},"body":"Hello everyone,\n\nI've recently encountered a bug/issue while using Git for Windows. You\ncan load a passphrase-secured SSH key into the ssh agent using\nssh-add. As long as the key is loaded into the ssh agent, you don't\nhave to enter the passphrase when using the key. However, when I do\ngit pull or something similar, Git still prompts me for the\npassphrase.\n\nThis is the Git version I'm using:\ngit --version\ngit version 2.47.0.windows.2\n\nBest Regards,\nJacob P.\n"},{"id":"507990","messageId":"Z0Oavzr03tTMiKfl@tapette.crustytoothpaste.net","threadId":"62533","inReplyTo":"CAFmt1jx9OHDnNRdcgB+sPNH90=eZYFRVEbO7PcETiN0ojMQi4Q@mail.gmail.com","subject":"Re: Bug with SSH keys loaded into ssh-add","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2024-11-24T21:29:35Z","receivedAt":"2024-11-24T21:29:38Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2024-11-24 at 16:23:21, Jacob Pfundstein wrote:\n> Hello everyone,\n\nHi,\n\n> I've recently encountered a bug/issue while using Git for Windows. You\n> can load a passphrase-secured SSH key into the ssh agent using\n> ssh-add. As long as the key is loaded into the ssh agent, you don't\n> have to enter the passphrase when using the key. However, when I do\n> git pull or something similar, Git still prompts me for the\n> passphrase.\n\nThis isn't Git prompting you for the passphrase.  Git passes the\nterminal through to OpenSSH, which is prompting you for the passphrase.\nThere's really nothing that Git can do, since it doesn't know what\nOpenSSH will do.\n\nI can make a guess about what might be going wrong here so you can try\nto see if that fixes things, and if not, you could try contacting the\nGit for Windows issue tracker at [0].  Please be sure to search first,\nincluding the closed issues, as the question may already have been asked\nand answered.\n\nMy guess as to what's going on is that you're using two different\nversions of OpenSSH, since there are two with Git for Windows.  One is\nshipped with Git for Windows, and one is the one shipped with Windows. I\nthink MSYS2 may implement sockets in an unusual way, which means that if\nthe agent is from one version and the `ssh` binary is from another\nversion, that they may not be able to communicate properly.  In such a\ncase, OpenSSH would prompt you again since it can't contact the agent.\nYou could try using both from the same version (I think there's an\ninstall option for that) or try using Git Bash to see if that fixes the\nproblem (even if that isn't a good solution for you, it's useful to know\nfrom a debugging point of view).\n\nAs I said, this is just a guess and I don't use Windows, so you'll have\nto try what I mentioned above or open an issue.\n\n[0] https://github.com/git-for-windows/git/issues\n-- \nbrian m. carlson (they/them or he/him)\nToronto, Ontario, CA\n"},{"id":"507993","messageId":"CAFmt1jxxnnhSysC0cLEptifY=cKLZ4rgBJ4gpp1O7=WkuMzeaA@mail.gmail.com","threadId":"62533","inReplyTo":"Z0Oavzr03tTMiKfl@tapette.crustytoothpaste.net","subject":"Re: Bug with SSH keys loaded into ssh-add","fromName":"Jacob Pfundstein","fromEmail":"jjpfst@gmail.com","sentAt":"2024-11-24T22:41:17Z","receivedAt":"2024-11-24T22:41:34Z","isPatch":false,"sender":{"key":"jjpfst@gmail.com","avatar":null},"body":"Hi Brian,\n\nthe issue was indeed solved by using the OpenSSH version that comes\nbundled with Windows instead of the one that ships with Git. Thanks a\nlot!\n\nBest Regards,\n\nJacob P.\n\nAm So., 24. Nov. 2024 um 22:29 Uhr schrieb brian m. carlson\n<sandals@crustytoothpaste.net>:\n>\n> On 2024-11-24 at 16:23:21, Jacob Pfundstein wrote:\n> > Hello everyone,\n>\n> Hi,\n>\n> > I've recently encountered a bug/issue while using Git for Windows. You\n> > can load a passphrase-secured SSH key into the ssh agent using\n> > ssh-add. As long as the key is loaded into the ssh agent, you don't\n> > have to enter the passphrase when using the key. However, when I do\n> > git pull or something similar, Git still prompts me for the\n> > passphrase.\n>\n> This isn't Git prompting you for the passphrase.  Git passes the\n> terminal through to OpenSSH, which is prompting you for the passphrase.\n> There's really nothing that Git can do, since it doesn't know what\n> OpenSSH will do.\n>\n> I can make a guess about what might be going wrong here so you can try\n> to see if that fixes things, and if not, you could try contacting the\n> Git for Windows issue tracker at [0].  Please be sure to search first,\n> including the closed issues, as the question may already have been asked\n> and answered.\n>\n> My guess as to what's going on is that you're using two different\n> versions of OpenSSH, since there are two with Git for Windows.  One is\n> shipped with Git for Windows, and one is the one shipped with Windows. I\n> think MSYS2 may implement sockets in an unusual way, which means that if\n> the agent is from one version and the `ssh` binary is from another\n> version, that they may not be able to communicate properly.  In such a\n> case, OpenSSH would prompt you again since it can't contact the agent.\n> You could try using both from the same version (I think there's an\n> install option for that) or try using Git Bash to see if that fixes the\n> problem (even if that isn't a good solution for you, it's useful to know\n> from a debugging point of view).\n>\n> As I said, this is just a guess and I don't use Windows, so you'll have\n> to try what I mentioned above or open an issue.\n>\n> [0] https://github.com/git-for-windows/git/issues\n> --\n> brian m. carlson (they/them or he/him)\n> Toronto, Ontario, CA\n"}]}