Vscode-gitlens: Git through SSH with passphrase-protected key when in WSL remote

Created on 19 Nov 2019  ·  7Comments  ·  Source: eamodio/vscode-gitlens

Good day! Thanks for a best-in-class extension!

I am trying to use git through SSH in a WSL remote. The SSH connection is protected with a key pair which is password-protected. How do I start an SSH agent and input that passphrase for a shell in which GitLens operates?

By default a bash/wsl shell is opened in terminal window on WSL remote connection. I start an SSH agent there and add the key, but it seems like this is not the shell in which GitLens is sending its git commands.

TIA!

help-wanted bug

All 7 comments

Hi ! Same situation here, how can we do that ?

Thanks,

Hi ! Have same issue.
It's not possible to open a prompt to enter passphrase for SSH Key ?

Maybe this could help
https://stackoverflow.com/a/60198798/11154427

TLDR:

  • regenerate your key, make sure it's not passphrase-protected
  • add the new public one in the ~/.ssh/authorized_keys file of the WSL session
  • don't forget to clone via SSH not HTTPS

It worked for me

make sure it's not passphrase-protected

This line makes the answer invalid for the case)

Oops I didn't see that before, sorry 🤦🏻‍♂️

This isn't something that I will likely add myself, but if the community wants to provide a PR I'm certainly open to it -- depending on the complexity and scope of the changes required.

It seems like native git support does not allow this either, so probably nothing to fix in the extension. Created an issue closer to the source of the problem)

Was this page helpful?
0 / 5 - 0 ratings