I use WSL with Ubuntu on my laptop to develop on Linux while I'm away from my desktop (with native Linux, where I don't experience any problems like this). I have private git repo setup, and I use ssh to connect to it. I have ssh configured (in .ssh/config), and I have multiple keys for my VPS, GitHub, other VPS user account etc. so I use ssh-add on my desktop to manage them. But on my laptop, in WSL, when I try to connect to my VPS, ssh asks for the passphrase to the key. When I try to do ssh-add .ssh/mykey I get an error:

$ ssh-add .ssh/mykey
Could not open a connection to your authentication agent.

But ssh-agent is running:

$ ps -e | grep ssh
4455 ?        00:00:00 ssh-agent
5517 ?        00:00:00 sshd
6164 pts/0    00:00:00 ssh

I don't see why is there a problem. If I kill currently running ssh-agent and launch it again (using eval $(ssh-agent -s)) it works fine.

  • For normal SSH in Windows to WSL in localhost, the configuration PasswordAuthentication yes must be added in /etc/ssh/sshd_config file. – Biswapriyo Oct 2 '18 at 20:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.