microsoft / microsoft/vscode-remote-release

Remote SSH does not handle "Match all" configuration correctly

Open
#11,146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ssh
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Is there an existing issue for this bug?
  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.
Required Troubleshooting Steps
  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar
[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I did not try step 2 of the troubleshooting steps

Remote-SSH Log
Remote-SSH Log

[19:01:15.787] Log Level: 2
[19:01:15.964] VS Code version: 1.103.0
[19:01:15.965] Remote-SSH version: remote-ssh@0.120.0
[19:01:15.965] win32 x64
[19:01:43.925] ConfigFileWatcher: start watching file:///c%3A/Users/frank/.ssh/config
[19:01:43.925] ConfigFileWatcher: adding save listener
[19:01:43.925] ConfigFileWatcher: adding close listener
[19:01:58.333] ConfigFileWatcher: closing file:///c%3A/Users/frank/.ssh/config
[19:01:58.333] ConfigFileWatcher: stop watching file:///c%3A/Users/frank/.ssh/config
[19:01:58.333] ConfigFileWatcher: removing save listener
[19:01:58.334] ConfigFileWatcher: removing close listener
[19:02:36.291] ConfigFileWatcher: start watching file:///c%3A/Users/frank/.ssh/config
[19:02:36.292] ConfigFileWatcher: adding save listener
[19:02:36.293] ConfigFileWatcher: adding close listener
[19:24:41.987] ConfigFileWatcher: closing output:remoteTunnelService
[19:27:19.239] ConfigFileWatcher: saving file:///c%3A/Users/frank/.ssh/config
[19:27:19.239] ConfigFileWatcher: firing change event for file:///c%3A/Users/frank/.ssh/config
[19:27:21.761] ConfigFileWatcher: saving file:///c%3A/Users/frank/.ssh/config
[19:27:21.762] ConfigFileWatcher: firing change event for file:///c%3A/Users/frank/.ssh/config
[19:27:28.751] ConfigFileWatcher: saving file:///c%3A/Users/frank/.ssh/config
[19:27:28.751] ConfigFileWatcher: firing change event for file:///c%3A/Users/frank/.ssh/config

Expected Behavior

Hosts in the configuration files are listed in the view of Remote Explorer.

Actual Behavior

No SSH hosts are listed, while tunnels are OK.

However, when commented out the "Match all" line in ~/.ssh/config, it works as expected. This can be verified by saving the edited configuration file and then click the refresh button in UI.

Steps To Reproduce
  1. In VS Code with Remote Explorer 0.6.2025072209
  2. With a configuration file having Match all line at first.
  3. See the listed SSH hosts in the Remote Explorer.
Anything else?

The minimal reproduction:

In file ~/.ssh/config:

Match all
Include ./local

In file ~/.ssh/local:

Host somehost
	User myname

Although the log pasted in from a Windows machine, this is largely irrelevant to OS because I first observed this behavior Ubuntu (running VS Code 1.102), and the log should have little help because this is not a connection issue. If I input the hostname manually in the textbox popping up by clicking the "+" button, it can connect succfully. But this defeats the purpose to have include files.

The Match all trick is needed for inclusion, in particular nested ones (not shown in the simplified case here).

Tested with ssh -G somehost and actual ssh somehost in both Linux and Windows. The command line can handle the configuration correctly as expected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with ~/.ssh/config containing Match all and Include ./local, plus a local file defining a host. Start by comparing Remote Explorer's host discovery with ssh -G somehost and the behavior after refreshing the view. Done means hosts from included configuration files appear in Remote Explorer while the Match all directive remains present.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.