fix(start-ssh-agent): support OpenSSH 10.1+ socket location#183
Merged
dscho merged 2 commits intogit-for-windows:mainfrom Feb 5, 2026
Merged
fix(start-ssh-agent): support OpenSSH 10.1+ socket location#183dscho merged 2 commits intogit-for-windows:mainfrom
dscho merged 2 commits intogit-for-windows:mainfrom
Conversation
Update socket search paths from "%TEMP%\ssh-*" to "%USERPROFILE%\.ssh\agent\s.*" to align with OpenSSH 10.1+ security improvement that moved agent sockets from /tmp to $HOME This preserves the security benefits of restricting filesystem access while maintaining compatibility with the new default location. Signed-off-by: SvenStaehs <staehs.sven@siemens.com>
6858184 to
b8b777f
Compare
Signed-off-by: SvenStaehs <staehs.sven@siemens.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Since Git for Windows upgraded to OpenSSH 10.2.P1 (which includes changes from OpenSSH 10.1), the
start-ssh-agent.cmdscript fails to locate ssh-agent sockets.Root Cause
OpenSSH 10.1 moved agent sockets from
/tmpto~/.ssh/agent/as a security improvement. From the OpenSSH 10.1 release notes:This ensures processes that have restricted filesystem access that includes /tmp do not ambiently have the ability to use keys in an agent.
Proposed Fix
This PR updates the script to search
%USERPROFILE%\.ssh\agent\instead of%TEMP%\ssh-*to align with OpenSSH's new default socket location.Why not use
-T?The
-Tflag exists to force the old/tmplocation but would revert the security improvement. The proper fix is updating the script to match OpenSSH's new default.This fixes git-for-windows/git#6084