Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using pageant with VSCode on Windows 10

I am trying to configure VSCode on my machine (Win10) to SSH to my remote servers using keys already loaded in Pageant running on the machine.

One way I found is to use "wsl-ssh-pageant", however I couldn't figure how to install on my machine even though I have WSL (Ubuntu)enabled on my machine.

Can someone help in configuring VSCode with pageant? Explain how to install "wsl-ssh-pageant".

Thanks

like image 483
vikramaditya234 Avatar asked May 13 '20 09:05

vikramaditya234


1 Answers

If Pageant has already loaded keys, then you can make a use of it by another application through the Plink (PuTTY Link) command-line interface.

If you want to work with e.g. a Git repository on remote server with credentials (keys), I have found a working solution: https://www.cgranade.com/blog/2016/06/06/ssh-keys-in-vscode.html (with already loaded keys to Pageant, the only missing part is last step 4).

You need to set a new environment variable in your Win10. For me it worked when I added a "system variable" not a "user variable".

The name of the variable is: "GIT_SSH"

The value is a full path to PuTTY\plink.exe, e.g: "C:\Program Files (x86)\PuTTY\plink.exe"

If you have VS Code opened already, close it and reopen again to make sure it sees the new environment variable.

Update (2021.11.10):

Now in my case, VSCode additionally needed what was described here in the solution: VS Code / Bitbucket / SSH - Permission denied (publickey)

like image 143
Daniel 'Thready' Nitecki Avatar answered Oct 26 '22 17:10

Daniel 'Thready' Nitecki