vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Remote SSH extension on Windows requires Windows-like paths in `~/.ssh/config`, whereas CLI `ssh` does not

Open zachsiegel-capsida opened this issue 2 years ago • 1 comments

  • VSCode Version: 1.68.1
  • Local OS Version: Windows 10
  • Remote OS Version: Ubuntu
  • Remote Extension/Connection Type: SSH
  • Logs: N/A

Steps to Reproduce:

  1. Use a ~/.ssh/config file with a line of the form IdentityFile /c/.../.ssh/xyz_rsa
  2. A Windows ssh CLI client (shipped with Windows 10 I believe, or preconfigured by IT dept) successfully finds the identity file using the unix-like path.
  3. The VSCode "Connect to Host" command (which finds and uses the same ~/.ssh/config file by default) does not successfully find the rsa identity file.
  4. Change the ~/.ssh/config file to use a Windows-like path: IdentityFile C:\\...\.ssh\xyz_rsa and both the ssh CLI client and VSCode's "Connect to Host" command succeed.

I would not necessarily call this a bug - I think the ssh CLI supporting both path formats is a "nice-to-have", but this extension, which by default consumes existing config files, kind of implicitly claims to support them with parity.

Shouldn't be hard to update to support this. Thank you!

zachsiegel-capsida avatar Jun 24 '22 17:06 zachsiegel-capsida

Thanks for creating this bug! I'll look at this in the upcoming iteration

tanhakabir avatar Jun 28 '22 16:06 tanhakabir

Looking at this issue again I don't think this is something that the Remote SSH should fix because it actually uses OpenSSH on your machine to do the connection. If OpenSSH for Windows expects Windows-like paths then I think we should expect the same.

tanhakabir avatar Aug 25 '22 19:08 tanhakabir

@tanhakabir thank you for this response. Two thoughts:

  • My Windows path uses a ssh executable that can make use of Unix-like paths (when using the default command prompt even). Maybe then the issue is just that VSCode is using a different ssh executable from the default one on the Windows path (apparently "OpenSSH on your machine") - I don't know why that would be.
  • I started using "Remote: WSL" for pretty much everything, and I do not have this issue. Kudos to whoever maintains that project, it is 99% of why I use VS Code.

zachsiegel-capsida avatar Aug 25 '22 20:08 zachsiegel-capsida

Oh OpenSSH is the default SSH client for Windows. I'm not sure if you use something else but essentially we call upon OpenSSH to do the connection via ssh your_remote in Powershell

tanhakabir avatar Aug 25 '22 20:08 tanhakabir