Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Read configuration from ssh_config #32

Open
joelspadin opened this issue Sep 19, 2020 · 4 comments
Open

Read configuration from ssh_config #32

joelspadin opened this issue Sep 19, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@joelspadin
Copy link
Owner

Using something like https://www.npmjs.com/package/ssh-config, we could read some settings such as the private key file so you don't have to set them again in vscode settings.

@joelspadin joelspadin added the enhancement New feature or request label Sep 19, 2020
@rcketscientist
Copy link

I have the same issue in #31. I'll give this a quick stab tonight.

@rcketscientist
Copy link

rcketscientist commented Oct 22, 2020

Quick and dirty first pass.
image

Connecting to [email protected] port 22 via user@bastion port 22
Connecting to user@bastion port 22
using private key
Connection closed.
Connecting to [email protected] port 22
using private key
Creating forwarding shell
Connection ready. Setting up display...
...
Display ready: localhost:10.0
x11 accept: 127.0.0.1

ssh-config is some js gobbledy-gook. It'll be very hard to cover edge cases. I'm going to time box (hours) pulling the fields automatically specifically for the Microsoft guide. I'm not sure how many other ways there are to skin this cat...
ProxyCommand ssh.exe -q -W %h:%p bastion

I'm thinking of the following:

Remote X11.SSH: Prefer Config
Experimental: Use remoteX11.SSH.sshConfig over other settings

In the meantime let me know what you think of Remote X11.SSH.jumpHost. Little funky the compressed format, but the single field makes it a bit easier to check this "all or nothing".

@joelspadin
Copy link
Owner Author

joelspadin commented Oct 23, 2020

For the SSH config setting, I think it makes sense to put it under an experimental setting like that.

I also think having everything for the jump host in one setting like that is fine, especially if that matches how you would set thing up on the command line. You can also set up a regex to validate the setting so it shows an error in the settings editor if it isn't formatted correctly (though the error message is often less than helpful because it just shows you the regex your setting fails to meet).

I've also done a little bit of work on merging the display and screen settings in a similar manner so that you can also set a host for the display but haven't finished testing that yet.

@rcketscientist
Copy link

I actually went to having the three discrete fields. Since there were multiple logic paths to the jump connect it was silly to creat that macro field in code.

However, I discovered quite a few bugs even with the limited surface here. I'll need to return to this early next week to bang out a few more kinks. I'd hold on reviewing it till then

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants