KEMBAR78
[Remote-SSH Bug]: SSH Config drops `=` characters when updated · Issue #10013 · microsoft/vscode-remote-release · GitHub
Skip to content

[Remote-SSH Bug]: SSH Config drops = characters when updated #10013

@Anwarvic

Description

@Anwarvic

Is there an existing issue for this bug?

  • I have searched the existing issues

Required Troubleshooting Steps

  • I have followed these troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting

Connect Locally

It connects successfully

Bug Description

Hi Team,

After the most recent VSCode update on 06/18/2024, whenever I add a new host using RemoteSSH, the extension addes the new host but also heavily changes the configuration file which disrupts any future connections to all servers in the configuration file. Here is the current VSCode version where this issue occurs:

Version: 1.90.2 (user setup)
Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
Date: 2024-06-18T22:34:26.404Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631

Kindly note that the earlier VSCode version didn't have this issue. However, I found this old issue: #6197 with similar problem.

Current Behavior

Let's assume that I have tihs configuration file:

Host TMP-3PLogs
  HostName YYYY
  IdentityFile ~/.ssh/id_rsa
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  ProxyCommand ssh -i ~/.ssh/id_rsa -W %h:%p -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null XXX@ZZZ
  User XXX

Now, let's add a new host using the following command in the Remote SSH + button, which basically adds the same host aleady in the configuration file (aka TMP-3PLogs).

ssh -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ProxyCommand="ssh -i ~/.ssh/id_rsa -W %h:%p -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null XXX@ZZZ" XXX@YYYY

Now, the configuration file changs to the following:

# the new host is added perfectly
Host ZZZ
  HostName YYYY
  IdentityFile ~/.ssh/id_rsa
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  ProxyCommand ssh -i ~/.ssh/id_rsa -W %h:%p -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null XXX@ZZZ
  User XXX

# the old configuratoin changed (see comments below)
Host TMP-3PLogs
  HostName YYYY
  IdentityFile ~/.ssh/id_rsa
  StrictHostKeyChecking no
  UserKnownHostsFile=/dev/null  # <--- `=` has been added
  ProxyCommand ssh -i ~/.ssh/id_rsa -W %h:%p -o StrictHostKeyChecking no -o UserKnownHostsFile /dev/null XXX@ZZZ # <-- all `=` have been removed
  User XXX

This nasty bug wasted two days of my life I'm not getting back 😞

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugsshIssue in vscode-remote SSHupstreamIssue identified as 'upstream' component related (exists outside of VS Code Remote)verifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions