Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection always refused #45

Closed
shokinn opened this issue Dec 22, 2020 · 5 comments
Closed

Connection always refused #45

shokinn opened this issue Dec 22, 2020 · 5 comments

Comments

@shokinn
Copy link

shokinn commented Dec 22, 2020

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:

  • Downloaded and put the wsl-ssh-pageant-amd64.exe to C:\Tools\wsl-ssh-agent\wsl-ssh-pageant-amd64.exe.
  • Create the directory C:\wsl-ssh-pageant
  • Run pagent
  • Loaded the public key to pagent (the key is stored in my KeePass file, KeePassXC loads the key into the pagent)
  • Started wsl-ssh-pageant-amd64.exe within cmd (C:\Tools\wsl-ssh-agent\wsl-ssh-pageant-amd64.exe --systray --wsl C:\wsl-ssh-pageant\ssh-agent.sock --verbose)
  • set SSH_AUTH_SOCK to SSH_AUTH_SOCK
  • Ran ssh-add -l

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
Copy link
Owner

benpye commented Dec 30, 2020

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

@shokinn
Copy link
Author

shokinn commented Dec 30, 2020

WSL 2.
grafik

@eneiford
Copy link

eneiford commented Jan 3, 2021

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

@kohenkatz
Copy link

Looks like a duplicate of #33

@benpye
Copy link
Owner

benpye commented Aug 6, 2022

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.

@benpye benpye closed this as completed Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants