SSH Agent with CLI

The Windows and Linux desktop clients have the “Enable SSH Agent” option. Does a similar option exist for the CLI? I’m trying to setup the SSH agent in WSL without using Window’s SSH agent.

2 Likes

I don’t know the answer to your question, but an alternative exits that works for me: SSH inside WSL can speak to the SSH Agent interface of Windows Bitwarden. Then when I ssh from inside WSL, the Windows Bitwarden GUI pops up and asks if I want to authorize the key to be used for the connection. If I authorize it, the connection is successful using the key from Bitwarden in Windows.

I’m still piecing together my configuration based on past experience and what I’ve ready on Forwarding SSH Agent requests from WSL to Windows - stuartleeks.com. If you are interested in this solution, let me know and I’ll try to share something fully-baked.

1 Like

I’m also using the agent with wsl vm’s which I setup using the npiperelay.exe writeup that is on medium. It feels fairly complete. I’d love to see this be a built-in feature in the future, but recognize why this is not a simple request.

1 Like

I have created a feature request for this. Feel free to vote at: SSH Agent: Native Support for SSH Agent in WSL

If I understand correctly the question is about using the command line tool bw.
I created a feature request Allow the Command-Line Bitwarden (bw) to act as an SSH Agent .

The usage for desktop bitwarden to work over WSL seems to be a separate issue.

Isn’t this already possible with SSH Agent Forwarding?
To the WSL session you want to provide with access to the ssh-agent:

ssh -A <Hostname>

So, if you have an ubuntu WSL2 host called foo.

ssh -a foo

Then any ssh work on foo should use the keys provided by Bitwarden desktop on the Windows host.