VS Code SSH user name cannot include the character \

Viewed 722

In Windows remote host I have username like WORK\username, and when I connect from Windows console:

ssh WORK\username@hostname

Everything is fine. Also I can connect from WSL with double slash:

ssh WORK\\username@hostname

But I can not connect from VS Code. I have an error:

Could not establish connection to "hostname": SSH user name cannot include the character \.

What to do with it, I have tried to escape the slash in different ways, but it was not work.

My VS Code version is 1.59.1.

1 Answers

It can be solved, when the username is stored in ~/.ssh/config

HOST myServer
   hostname example.com
   USER WORK\username

Obviously the connection should be started then from the Remote Explorer.

Tested successfully with VS Code version 1.59.1 on Windows and also Linux

Related