-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git SSH conflicting with OpenSSH integrated in Windows #2944
Comments
That's a good idea. You could even give it a try:
|
I could, but unfortunately I have no time to dedicate to implementing it myself. I think the community of Git for Windows should decide on the general approach, I have no knowledge of what's better, given the fact that you're working even on credential managers and this may overlap. Also an option 0.1% of the users will unclick is probably not the best, a more holistic approach should be thought. I prefer the Git for Windows core team takes a decision. |
In the past, I have tried configuring Git to use the OpenSSH installed by Windows. It was pretty easy to set up but tended to hang during Git operations. Perhaps that was caused by PowerShell/Win32-OpenSSH#1377. Anyway, I recommend postponing this until Windows upgrades its OpenSSH to a fixed version. |
I ran into the same issue yesterday as I'm using the windows openSSH with a GnuPG smartcard and wondered that git doesn't pick my key provided by the agent. Configuring git via the environment variable or config variable works but it would be somehow better to tell git somehow to use the included binaries instead of its own (helps against forgetting to configure and wondering why it doesn'r work). |
Sure. This would have to be a new option in the installer. Meaning: someone with enough time on their hands needs to do it.
Did you experience the issue at any time? |
👋🏼 I am the maintainer of https://github.com/webfactory/ssh-agent, a GitHub Actions (GHA) module to set up the SSH Agent with private keys for use in the GitHub Actions Build/CI/Automation service. While trying to make this work in the Windows virtual environment as well, I came across the same problem that both sets of the SSH binaries seem to be incompatible or at least not "talk" to each other (webfactory/ssh-agent#63). While I understand that the needs of such an GHA module are not the basis for your decision here, please take into consideration that the version of SSH provided by Windows seems to have some deficiencies. These include:
To me it seems that the version of |
The SSH agent provided by Windows has its problem, some of them fixed in upcoming versions, some not yet. I suggest you to report your findings to Microsoft on GitHub if not yet done. Note also the SSH agent is implemented as a Windows Service, so it seems to be quite different than the classic Linux ssh-agent. Perfectly fine if Git for Windows keeps its own ssh-agent. My suggestion is just to introduce the (non-default?) option to not install it. If you open a command prompt and type |
Would that be on https://github.com/PowerShell/Win32-OpenSSH or https://github.com/PowerShell/openssh-portable? |
The README of the former forwards to the latter, so https://github.com/PowerShell/openssh-portable. |
But the README of the former also says...
(Emphasis mine 😉) |
My suggestion on top of your suggestion still is: #2944 (comment) |
Addressed via git-for-windows/build-extra#367. |
Git for Windows installs SSH binaries by default, together with a lot of other linux tools.
Starting from (at least) Windows 10 version 19.09, Microsoft integrated directly a version of OpenSSH client. For example,
ssh-agent
is a proper Windows Service, that seems to persist the keys somewhere in the user profile. I think this is even installed by default, while the corresponding OpenSSH server is also available for a manual installation. Both can be installed via the Manage Optional Features settings panel.The problem is that the OpenSSH integrated in Windows and what is shipped with Git for Windows don't talk to each other. Keys added to the
ssh-agent
Windows service are not looked up bygit
command from Git for Windows when working withssh://
repositories. Depending on the order of entries in thePATH
environment variable, one is used by default instead of another. On my installation, VS Code launches the Windows'ssh
and expect keys to be available in the Windows' service. Usingstart-ssh-agent
works, but that agent is not consulted.The general solution is to configure
GIT_SSH
, pointing explicitly to the implementation wanted, but this is a manual process users have to discover first, and then do.To avoid this overlap, I propose that an option is given not to install SSH together with Git for Windows. I can't suggest what its default setting should be, or if it's better to build a package without SSH, or else, but I think you should be aware of the problem and think about a better integration with recent versions of Windows 10.
Additional info: https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_overview
The text was updated successfully, but these errors were encountered: