Replies: 7 comments
-
Maybe there's a simple way by adding a unix domain socket directly to WSL When the WSL COM interface becomes documented better, the Win32-openssh devs might be able to implement this themselves without help from the WSL team. You could even build a proof of concept now using the undocumented interface and some of the tricks used in Alex Ionescu's lxext/lxserver project. You could even implement it now with the following (vaguely): Take Alex Ionescu's lxserver source code and replace the guts of it with something that just forwards unix domain socket communications back and forth to the socket on the ssh-agent service. Then modify lxext's sourcecode so that it just opens a socket as usual and forwards that on to the lxserver. Then finally, set the ssh_auth_agent environment variable to the location of lxext's socket, which is by default
At least, that's the handwavey way to do it. You could probably directly add the lxserver side of this to the ssh-agent sourcecode directly (avoiding the separate lxserver that is forwarding messages), but you still need something (at least right now) like lxext on the linux side to open up the socket and push it through the lxssmanager boundary, because to my knowledge, there is no way to tell WSL's init to open a socket for you directly, though this might be a feature added to the lxssmanager service in the future. |
Beta Was this translation helpful? Give feedback.
-
Now that the OpenSSH beta client is publicly available, is there any news around making this possible? Would love to see this use case so ssh key management gets a lot simpler across the Windows / WSL boundary. |
Beta Was this translation helpful? Give feedback.
-
Something like this: https://github.com/rupor-github/ssh-agent-wsl? |
Beta Was this translation helpful? Give feedback.
-
@rupor-github yeah, but I think it could be made even more streamlined now with the WSL-windows direct socket connections added in 1803. https://blogs.msdn.microsoft.com/commandline/2018/02/07/windowswsl-interop-with-af_unix/ |
Beta Was this translation helpful? Give feedback.
-
You may be right - but it will require changes in openssh-portable. Also, from https://blogs.msdn.microsoft.com/commandline/2018/02/07/windowswsl-interop-with-af_unix/ : "A WSL Unix socket can only communicate with a Win32 Unix socket OR with a WSL Unix socket, but not both. For instance, a WSL Unix socket server can only accept connections from either WSL Unix socket(s) OR Win32 Unix socket(s). So, how is it determined which one is it? It’s based on the path the socket is bound to or connecting to, as specified in the Not sure how "streamlined" this would be.... |
Beta Was this translation helpful? Give feedback.
-
The OP ask, at least as imagined sharing Notwithstanding open #5961 there is no WSL actionable "could the two talk to each other". Porting over to discussion forum for tips/tricks. |
Beta Was this translation helpful? Give feedback.
-
There's a wonderful ssh port by ... um... Microsoft :) Could the two talk to each other please?
Beta Was this translation helpful? Give feedback.
All reactions