microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.62k stars 277 forks source link

Using SSH with @ character in the username #9061

Closed kerem0comert closed 9 months ago

kerem0comert commented 11 months ago

Does this issue occur when all extensions are disabled?: Yes

I would like to SSH into a host where we have such a configuration:

Host example.com
  HostName example.com
  User username@example.com

It is a bit unconventional to have the "@" char in the username perhaps, but in any case I would like it to resolve to: username@example.com@example.com

Unfortunately, this does not work as it seems VSCode is not able to interpret having two "@" chars correctly. Tried many options to escape the "@" char in username, use string quotations around the User parameter, or try some commands from the ProxyCommand field such as:

Host example.com
  HostName example.com
  User dummy
  ProxyCommand ssh -q 'username@example.com'@example.com -W %h:%p

but nothing seems to have worked so far. Looking forward to any suggestion.

Steps to reproduce: 1- Have the following ssh.config:

Host example.com
  HostName example.com
  User username@example.com

2- Click on the SSH icon on bottom left of the editor 3- Click on Connect to Host and select the option with the relevant host.

roblourens commented 9 months ago

Remote-SSH is not interpreting your ssh config file, we really only run a normal ssh command and let ssh do the rest as usual. So if ssh example.com does the right thing, and your config is respected by ssh, then it would work. I have no idea whether ssh allows a User property like that.