Hacker News new | ask | show | jobs
by zanecodes 5 days ago
You can with something like this: https://github.com/rupor-github/wsl-ssh-agent#wsl-2-compatib...

I run ssh-agent in Windows, and then have a socket-activated systemd service that uses the above program to forward the SSH agent socket to the Windows ssh-agent. I have a similar setup for my GPG agent. This lets me seamlessly use my Yubikey for SSH/GPG in both Windows and WSL.

You could also use something like usbip to expose the Yubikey to your WSL distro as a USB device, but this has to be done manually each time you want to use it, and you can't use it in Windows until you manually switch it back.