Wslssh
Wslssh forwards SSH command from VSCode Remote-SSH to WSL and enables SSH configuration sharing.
Quick Start Guide
Download or compile wslssh and put it into a directory in Windows filesystem (e.g. C:\Users\<Windows User>\bin\wslssh.exe
).
Next, open VSCode configuration window and look for Remote.SSH: Path (or remote.SSH.path
in the JSON file) and fill it with the absolute path to wslssh executable.
Then, to enable SSH configuration sharing with WSL, look for Remote.SSH: Config File (or remote.SSH.configFile
) and fill it with the absolute path of the .ssh/config
file, usually located in \\wsl$\<Distro Name>\home\<WSL User>\.ssh\config
.
Now try to connect to one of the SSH Targets from the VSCode's Remote Explorer bar.
Caveats
This program only tested to work on WSL2.
SSH configuration sharing only works when the WSL distro is active. This is mainly due to the WSL filesystem mount limitation.
If the config file left unset, SSH command will be forwarded to the default WSL distro instead.
If the config file points to other than WSL mount directory, the SSH command will also be forwarded to the default WSL distro but it only would work if the path exists within the distro.
It is not possible to use different SSH config from other distro's SSH client binary (e.g. using Debian's ssh
command with Ubuntu's $HOME/.ssh/config
).
Why is it written in Go?
I don't have any experience in writing .bat
or .ps1
scripts.
License
Copyright (c) 2021 Fadhli Dzil Ikram.
This software is licensed under the MIT license. Please see the license file for more information.