benpye / wsl-ssh-pageant

A Pageant -> TCP bridge for use with WSL, allowing for Pageant to be used as an ssh-ageant within the WSL environment.
BSD 2-Clause "Simplified" License
619 stars 40 forks source link

Windows OpenSSH client error #18

Closed aviadmini closed 3 years ago

aviadmini commented 5 years ago

Couldn't run --winssh

Related issue: https://github.com/PowerShell/Win32-OpenSSH/issues/1319

benpye commented 5 years ago

Are you still hitting this? I will try and repro this either later this week or this weekend. I haven't used the OpenSSH support heavily.

aviadmini commented 5 years ago

I had the same issue in both 1803 and 1809 systems, still happening

benpye commented 5 years ago

Can you try the Go version I just uploaded https://github.com/benpye/wsl-ssh-pageant/releases/tag/050219 . I haven't hit this locally but I have yet to try 1803.

schrej commented 5 years ago

The go version is working for me on Windows 10 1803 with Win32-OpenSSH v7.9.0.0p1-Beta

benpye commented 5 years ago

@aviadmini Any luck? It seems strange that nobody else has his this and it doesn't look like a permissions issue which is fairly common. Another thing that might be worth trying is to try the latest OpenSSH for win32 release - I have hit issues with the shipping version.

aviadmini commented 5 years ago

I didn't manage to make it work but the error is different.

I'm running the go version like this wsl-ssh-pageant-amd64.exe -winssh wsl-ssh-pageant and keep the console window open with Listening on named pipe: \\.\pipe\wsl-ssh-pageant I have a system env var and when I execute echo %SSH_AUTH_SOCK% it outputs wsl-ssh-pageant

When I'm executing ssh -T gitlab.com -vvv I'm getting these lines:

debug3: unable to connect to pipe wsl-ssh-pageant, error: 2
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
schrej commented 5 years ago

The instructions say to set SSH_AUTH_SOCK to \\.\pipe\wsl-ssh-pageant...

aviadmini commented 5 years ago

My bad. Changed it to correct one and got past that error. Now getting

debug1: Authentications that can continue: publickey
debug1: Offering public key: Old GitLab RSA SHA256:FAkBr7cFFlBUY10IioHao3BJ8GmoCZMIIZfHV3M4nBc agent
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
...

It looks like it sends the keys but it still doesn't work - permission denied. While same key is used for WSL and it works there.

benpye commented 5 years ago

What OpenSSH build are you using? I would try using the 7.9 build - I've seen some weirdness with the older version.

aviadmini commented 5 years ago

I believe I was using that one - iirc it was latest at the time of writing

benpye commented 4 years ago

@aviadmini Sorry - going back through issues to try and sort through. I never did manage to repro this, did you have any luck?

benpye commented 3 years ago

Closing this - if this hits again please reopen/create a new bug.