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

Following Instructions for WSL results in invalid ELF header #62

Open arcsector opened 5 months ago

arcsector commented 5 months ago

I am trying to get pageant working with WSL2 on windows 10 build 1903 - I'm mainly stuck on the part where the SSH agent opens the DLL for pageant to prompt for authentication. I'm running the following command for my socket on windows Powershell (unelevated):

> pwd
C:\Users\user\.wsl\
> ls
wsl-ssh-pageant.exe
> .\wsl-ssh-pageant.exe --wsl C:\Users\haraksin\.wsl\ssh-agent.sock --systray
2024/01/22 12:59:26 Listening on Unix socket: C:\Users\user\.wsl\ssh-agent.sock

My pageant certificate is a dll, which I have stored in my WSL SSH config as such:

Host myhost-test.com
        User user
        PKCS11Provider "/mnt/c/Program Files/HID Global/ActivClient/acpkcs211.dll"

and when WSL2 tries to open that, it fails with this message:

dlopen /mnt/c/Program Files/Package/acpkcs211.dll failed: /mnt/c/Program Files/Package/acpkcs211.dll: invalid ELF header

I'm unsure where this is failing, at the Npiperelay, or the ssh socket, so I thought I'd start here. Thanks for the help, and I hope this gets other people to a closer solution.