This article documents using Pageant to manage SSH keys for VS Code Remote.
1. Assumptions
- VS Code and the VS Code Remote Development extension is installed
- PuTTY Pageant is being used to manage SSH keys
- The remote host has a corresponding public key
2. Introduction
VS Code Remote Development doesn’t support Pageant out of the box.[1] More specifically, VS Code Remote Development uses the Windows 10 native OpenSSH client and the OpenSSH client doesn’t support Pageant. A bridge is needed to make Pageant available to the OpenSSH client.
This is where wsl-ssh-pageant
comes in.
wsl-ssh-pageant
can make Pageant available to WSL or the Windows OpenSSH client.
We are going to use it to make Pageant available to the Windows OpenSSH client.
3. Install wsl-ssh-pageant
Download wsl-ssh-pageant-amd64-gui.exe
from the latest release of wsl-ssh-pageant
[2]
4. Setup wsl-ssh-pageant
- Open the startup directory by pressing ⊞Win+R and typing
shell:startup↵
Create a
.bat
file with the following content[3]@ECHO OFF SETX SSH_AUTH_SOCK \\.\pipe\ssh-pageant START /B "" "C:\SSH\wsl-ssh-pageant-amd64-gui.exe" --systray --winssh ssh-pageant
- Run the
.bat
file
5. Use VS Code Remote Development
Open VS Code and connect to a remote host. You should no longer be prompted for a password.
- As of VS Code v1.51. ↩
wsl-ssh-pageant
v20201121.2 as of this writing. ↩- Sourced from microsoft/vscode-remote-release#61. ↩