SSH in Visual Studio Code with KeePass
Remote SSH extension in Visual Studio Code allows you to directly edit files on a Linux machine and access the Linux console from your Windows workstation. For the best comfort when accessing a remote SSH server from Visual Studio Code, use KeePass with KeeAgent, which works as an SSH agent. Why Use KeePass and KeeAgent?
KeeAgent is an excellent plug-in for KeePass that works similarly to the integrated Pageant (from PuTTY tools). Once you unlock your passwords in KeePass, KeeAgent allows you to access your SSH key through an agent, making authentication seamless and secure.
Using Your SSH Key in Visual Studio Code
To use your KeeAgent or Pageant SSH key in Visual Studio Code, you need to use the Plink utility, which functions as a console SSH client supporting Pageant or KeeAgent cached SSH keys. Download Plink here: Plink Download
Studio Code and Plink
Unfortunately, Visual Studio Code does not support Plink automatically, but it does support the command-line SSH client. For this reason, there’s a project called ssh2plink, which acts as an SSH console client but is based on Plink, supporting KeeAgent.
You can get it here: SSH2Plink Step-by-Step Setup
Step 1 – Compiling SSH2Plink#
git clone https://github.com/MarkusDeutschmann/ssh2plink
choco install go # if you do not have Go language installed and have choco package manager
./build.cmd
Step 1 (Alternative) – Download Pre-built Images#
ssh2plink_32bit.exe
ssh2plink_64bit.exe
Step 2 – Copy File for Your Platform into PuTTY Directory#
C:\Program Files\PuTTY
Step 3 – Set Up in Remote-SSH Plugin#
4 – Set GIT_SSH Environment Variable to Plink#
Set the GIT_SSH environment variable to point to your Plink executable.
The Next Level – Windows Hello#
The next level for this setup is to use the Windows Hello plug-in for KeePass, which allows you to authenticate through your face (e.g., with a Logitech Brio), fingerprint, or PIN code. This adds another layer of security and convenience to your workflow.
Summary#
By combining KeePass, KeeAgent, Plink, and Visual Studio Code, you can have a secure and comfortable SSH experience from Windows to Linux. With the additional use of Windows Hello, you can further enhance your authentication process.
Happy coding! 🚀