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
612 stars 40 forks source link

Connection always refused #45

Closed shokinn closed 1 year ago

shokinn commented 3 years ago

Hey there, I'm currently facing the issue no matter what I do, I always get an Connection refused by the ssh-agend inside of my WSL 2 instance.

Here what I did:

Output inside of WSL:

[phg@AINCRAD ~]$ export SSH_AUTH_SOCK=/mnt/c/wsl-ssh-pageant/ssh-agent.sock
[phg@AINCRAD ~]$ ssh-add -l
Error connecting to agent: Connection refused

Output from wsl-ssh-pageant-amd64 running on windows:

C:\Users\philip>C:\Tools\wsl-ssh-agent\wsl-ssh-pageant-amd64.exe --systray --wsl C:\wsl-ssh-pageant\ssh-agent.sock --verbose
2020/12/22 15:47:05 Listening on Unix socket: C:\wsl-ssh-pageant\ssh-agent.sock

The strange thing is that I don't get any log messages that there was a try to connect to socket.

I also tried to put the socket file in different locations. No change of this behaviour.

Any Ideas where i'm doing mistakes?

benpye commented 3 years ago

Just to check, is this WSL 1 or WSL 2?

shokinn commented 3 years ago

WSL 2. grafik

eneiford commented 3 years ago

I am experiencing the exact same behavior. Any update / resolution?

kohenkatz commented 3 years ago

Looks like a duplicate of #33

benpye commented 1 year ago

Thanks @kohenkatz - it does look like this is a duplicate of #33 . Unfortunately WSL 2 doesn't have any AF_UNIX type socket support, so using the named pipe with npiperelay is probably the best solution.