vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Support `Include` in ssh config

Open YDX-2147483647 opened this issue 1 year ago • 16 comments

In OpenSSH, you can use Include to split ssh config into multiple files.

For example:

~/.ssh/config:

Include config.d/*

~/.ssh/config.d/company: (copied from #9370)

Host ServerA
    HostName website.domain.com
    User ubuntu
    IdentityFile {myKey}

Current

Remote - SSH extension ignores Include.

Desired result

It should be equivalent to the following.

YDX-2147483647 avatar Mar 18 '24 11:03 YDX-2147483647

This should work, it's working for me on mac, I'll check Windows

roblourens avatar Mar 22 '24 15:03 roblourens

I'll check Windows

Hi! Have you checked? Do you need any additional information?

YDX-2147483647 avatar Mar 28 '24 05:03 YDX-2147483647

Hello,

We have the same regression here (using Windows 11) with recent versions of the extension.

The problem is really coming from the wildcard, based on our tests:

# ~/.ssh/config
Include conf.d/*  # <-- Doesn't work (but used to)
Include conf.d/myconf.conf  # <-- Actually works

florentcpt avatar Apr 13 '24 08:04 florentcpt

the wildcard

I can verify it on Windows 10. So currently a workaround would be expanding the wildcard on our own.

YDX-2147483647 avatar Apr 13 '24 15:04 YDX-2147483647

Not working on macos. Neither with nor without wildcard in Include section. Here is example w-wildcard wo-wildcard

Also, i guess Match all is not a valid host to display in connections list

tony-sol avatar Apr 27 '24 11:04 tony-sol

I confirm wildcard Include do not work on macos. I have this in the end of my ssh_config

Match all
Include ~/.ssh/config.d/*.config

VSCode is showing all in the list of available connections. Match and Match all should definitely be ignored by VSCode

den-is avatar May 03 '24 07:05 den-is

Not working for me either on macos.

torchsmith avatar May 08 '24 01:05 torchsmith

@roblourens Hi Rob, since this is standard OpenSSH functionality, do you think we can get some priority assigned to this issue?

torchsmith avatar May 08 '24 01:05 torchsmith

This code hasn't changed in quite a while. Can someone try downgrading the extension (in the extension view, right click > Install Another Version) to help me figure out when it stopped working for you? Otherwise I just need to add a lot of logging or something. I'm not seeing any issues.

roblourens avatar May 08 '24 04:05 roblourens

Can someone try downgrading the extension

Here you are:

  • 0.107.1 works,
  • 0.108.0 does not.

Tested on Window 10, with bare Include config.d/* (no Match all) as ~/.ssh/config.

(Just ping me if you need further information.)

YDX-2147483647 avatar May 08 '24 07:05 YDX-2147483647

someone try downgrading the extension

tested on macos 14.4.1

Include config.d/* not working if this sections is under Match group.

If use Include without any match group, it works on latest, otherwise - not working in any version.

Also, nested Include, like

~/.ssh/config

Include config.d/*

~/.ssh/config.d/config

Include config.d/test/*

~/.ssh/config.d/test/config

Host A

Works only since 0.66.0

Showing match groups working since 0.94.0

tony-sol avatar May 08 '24 07:05 tony-sol

Im on version v0.110.1 and it's not working with just the Include.

torchsmith avatar May 08 '24 12:05 torchsmith

v0.107.1 does not work for me. macos.

Include ~/.ssh/configs/conf.conf

torchsmith avatar May 08 '24 12:05 torchsmith

I cant seem to find any version that works for me actually.

torchsmith avatar May 08 '24 12:05 torchsmith

In order to include two files I have to do this:

Match
Include ~/.ssh/configs/B.conf
Include ~/.ssh/configs/A.conf

Match
Include ~/.ssh/configs/Aconf
Include ~/.ssh/configs/B.conf

But then I get a "Match missing parameter" error.

torchsmith avatar May 08 '24 12:05 torchsmith

New updates.

Latest version (v0.110.1) works with just Include.

The issue is that in order for it to work it needs to be at the the very top of my config. Before it was underneath a Host * statement. (Which works with normal ssh in terminal).

torchsmith avatar May 08 '24 12:05 torchsmith

I see, I think what is being described is essentially https://github.com/microsoft/vscode-remote-release/issues/4339. Will take a look when I'm able

roblourens avatar May 31 '24 01:05 roblourens

No, there's just a lot going on here #4339 still exists. But also it seems like glob includes regressed on Windows. Probably when I updated the 'glob' package. Taking a look.

roblourens avatar May 31 '24 01:05 roblourens

The 'glob' package behavior changed on Windows- fix coming in June. Sorry for the break.

roblourens avatar May 31 '24 18:05 roblourens

@roblourens when will this update be pushed to stable so we can test it out?

torchsmith avatar May 31 '24 19:05 torchsmith

All VS Code/extension releases are paused right now for stabilization before the release. This will be in the next Remote-SSH pre-release towards the end of next week.

roblourens avatar May 31 '24 20:05 roblourens

Is there issue about Match includes in servers list? Didn't find any :c

tony-sol avatar Jun 07 '24 14:06 tony-sol

Any updates? When fix is going to be released?

den-is avatar Jun 13 '24 09:06 den-is

Sorry, the release got delayed due to technical difficulties 🙂 we are working on getting it out

roblourens avatar Jun 13 '24 17:06 roblourens

Wow, after the update, the long-missed wildcard SSH hosts are back. Thank you so much! 😊

PillarsZhang avatar Jun 14 '24 17:06 PillarsZhang

There is something wrong in here, i believe

include-after-match include-before-match

tony-sol avatar Jun 14 '24 17:06 tony-sol

Wow, after the update, the long-missed wildcard SSH hosts are back. Thank you so much!

@PillarsZhang what version are you talking about? I still have original v0.112.0 from 2024-06-14, 08:44:49 which is not rendering my .ssh/config and not fetching "included" hosts

den-is avatar Jun 14 '24 17:06 den-is

@den-is I'm using v0.113.2024061415 (pre-release), but when I reverted to the released version v0.112.0, all the hosts were still there. I'm not sure if it's because of an updated dependency. I have VS Code and VS Code Insiders installed on two different computers, and both exhibit the same behavior.

PillarsZhang avatar Jun 14 '24 17:06 PillarsZhang

any updates on this? I thought you were going to release the last month. Now I suppose it is blocked by the another new VSCode version?

den-is avatar Jul 01 '24 06:07 den-is