cuviper / ssh-pageant

An SSH authentication agent for Cygwin/MSYS to PuTTY's Pageant.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use case: Windows' new ssh client

opened this issue · comments

Microsoft have added a port of OpenSSH to the preview editions of Windows - you can grab it without being in the beta via https://github.com/PowerShell/Win32-OpenSSH/releases

I tried using ssh-pageant as a "bridge" (because I still need to use Pageant for Filezilla) but I get the following error after setting $env:SSH_AUTH_SOCK and running ssh-add -L

error fetching identities: invalid format

Has Microsoft published the sources for openssh as they're shipping it? We'd need to see how they're using SSH_AUTH_SOCK and imitate that. (I doubt it's the same as Cygwin's version of unix sockets.)

Oh, that was a silly question... the link you gave is the source.

Oh wow, they've actually implemented AF_UNIX:
https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

Beginning in Insider Build 17063, you’ll be able to use the unix socket (AF_UNIX) address family on Windows to communicate between Win32 processes.

AFAICT they're depending on this in Win32-OpenSSH. There are a lot of compatibility hacks -- see all the WIN32_FIXME in the source -- but it's still using AF_UNIX sockets for the agent. If you're not using the insider build, are you able to use their own ssh-agent successfully?

I don't expect the current Cygwin/MSYS builds of ssh-pageant will be able to talk to this. Cygwin has implemented their own version of AF_UNIX for a long time, surely incompatible with this new thing. Perhaps eventually Cygwin will adopt that native AF_UNIX. But I do think it should also be possible to make a native (non-Cygwin/MSYS) ssh-pageant that works with that new AF_UNIX support.

I don't plan on updating my own machine to any pre-release Windows though, so it may be a while before I can work on this.

Seconding your wow, there.

I'm only on 1703, but after installing the SSH agent service (see their ps1 scripts) I was able to use the agent on Windows.

@cuviper They're actually using Windows named pipes for IPC instead of Unix sockets, which is why neither ssh-pageant nor gpg-agent works with it so far. See PowerShell/Win32-OpenSSH#827

commented

There is indirect descendant of this project: https://github.com/rupor-github/ssh-agent-wsl which talks to Windows ssh-agent from WSL - you may be able to adopt its "named pipe" part here.