Win32-OpenSSH icon indicating copy to clipboard operation
Win32-OpenSSH copied to clipboard

Support SSH_AUTH_SOCK Unix Domain Sockets for Windows

Open andrewpmartinez opened this issue 3 years ago • 11 comments

gpg and gpg-agent support opening a Unix Domain Socket in Windows for use with SSH. However, this appears to fail as OpenSSH for Windows does not support Unix Domain Sockets when configured in SSH_AUTH_SOCK.

There are ways to bridge this using third-party programs such as https://github.com/benpye/wsl-ssh-pageant and configuring gpg and gpg-agent to run in pageant mode and using the aforementioned program to open a named pipe that can work with OpenSSH for Windows when set to SSH_AUTH_SOCK.

andrewpmartinez avatar Mar 30 '21 15:03 andrewpmartinez

There is some limited support for AF_Unix https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ with interop with WSL:https://devblogs.microsoft.com/commandline/windowswsl-interop-with-af_unix/. Likely this socket support will be added to same place as the AF_Unix code and possibly re-use some of it.

WSLUser avatar Jun 08 '21 13:06 WSLUser

I have requested this some time ago in #1024 and it is tagged as "0 - Backlog", now

Rondom avatar Jun 08 '21 22:06 Rondom

@Rondom , @adityapatwardhan , @WSLUser - We have very limited resources to work on this project. This is not prioritized currently.

bagajjal avatar Jun 08 '21 22:06 bagajjal

We always welcome community support.

bagajjal avatar Jun 08 '21 22:06 bagajjal

@bagajjal Unless Windows is open-sourced, nobody outside of the company has access to the code changes needed internally. Without those internal changes, anything done in this project will be unable to be validated. Support of this project really ought to be more considered as security should come first before anything else, which this project is specifically based on. The RDP work for RAIL and VAIL are awesome but not substitutes for openssh as a remote communication protocol.

WSLUser avatar Jun 09 '21 13:06 WSLUser

@WSLUser - Looks like there is some misunderstanding here. Win32-openssh shipped into windows is compiled from Microsoft internal repository. We are mandated to use Microsoft internal repository for fixing any security bugs (which are shipped first through windows update and later shipped as github release) and CI system mandates us to maintain an internal repo.

Having said that, the Microsoft internal repository code is 99% close to github repository. Eventually the code changes from Microsoft internal repository will flow to github repository.

To summarize, github openssh community can always contribute. fyi, there are many PRs from community that got merged into github and shipped as windows release and github release.

bagajjal avatar Jun 09 '21 17:06 bagajjal

Specifically for the socket support as raised in this issue and the other, that support needs to come from Windows, not openssh. Win32-OpenSSH needs to be updated to allow usage of SSH_AUTH_SOCK but that socket communication protocol needs to be implemented in the Windows source code and it's highly likely that support to be added in the same place as the AF_Unix code. I understand there's a Linux Systems Group in MS that handles all sorts of Linux things. This request would fall in scope of that group to assign to the appropriate team to be implemented. Code changes needed in Windows don't equal the code changes needed in Win32-OpenSSH.

WSLUser avatar Jun 09 '21 19:06 WSLUser

Agree. I think this is the correct repo https://github.com/microsoft/WSL/issues to open an issue.

bagajjal avatar Jun 09 '21 19:06 bagajjal

Well they're on the group and maybe can forward it but I don't think the WSL devs themselves do the work (though I think they did before for AF_Unix as that Linux Systems Group didn't exist yet as far as I'm aware).

WSLUser avatar Jun 10 '21 12:06 WSLUser

We've been officially punted back to this issue for tracking internally at MS. I expect once the new year hits, somebody will reach out to you @bagajjal.

WSLUser avatar Dec 15 '21 16:12 WSLUser

Is there any update on this issue? Or is there a better source other than this issue?

andrewpmartinez avatar Jul 13 '22 13:07 andrewpmartinez