Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode Rejects Backslash as Valid Host Name #6701

Closed
Somainer opened this issue May 9, 2022 · 1 comment
Closed

VSCode Rejects Backslash as Valid Host Name #6701

Somainer opened this issue May 9, 2022 · 1 comment
Labels
ssh Issue in vscode-remote SSH

Comments

@Somainer
Copy link

Somainer commented May 9, 2022

VSCode Version: 1.67.0
What type of remote connection you were using: SSH
Remote - SSH Version: 0.78.0
Local OS: Darwin x64 21.4.0
Remote OS Version: Windows 10.0.22000.613

Steps to reproduce:

  1. In command palette, select Remote-SSH: Connect to Host...
  2. Type in user@host where user contains backslash.

Background

I am trying to connect to a windows device using vscode via ssh, and my windows account is an AAD account.

Problem

According to this comment, to connect to a windows Azure AD account via SSH, a workaround is to use connection with format ssh azuread\user@microsoft.com@ipaddress. This format contains backslash \, which will be rejected by VSCode remote SSH extension.

Workaround

I tried to remove the backslash in ~/.vscode/extensions/ms-vscode-remote.remote-ssh-0.78.0/out/extension.js:1:672307,
change const V="'\"!%\r\n".split(""); in function assertValidHost, removing the first \ character, and then it worked perfectly. Which means in some case \ could be part of a valid host name.

Another workaround is to manually edit ssh config, add host username with backslash, then connect to that host. (#6172 )

Since ssh config allows user name with backslash, does assertValidHost reject backslash make sense?

@github-actions github-actions bot added the ssh Issue in vscode-remote SSH label May 9, 2022
@tanhakabir
Copy link

Thank you for investigating this! I'll have this fixed with #6172 so I'll close this as a duplicate

@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

2 participants