SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Allow multi-hop ssh #290

Closed AlexEvansRaven closed 2 years ago

AlexEvansRaven commented 2 years ago

I need to be able to ssh into a remote machine, then hop via ssh to another machine's file system on the local vlan. This gets me close, so I can at least edit the first remote machine in vscode, but it would be great to be able ditch vi in the cli entirely if I could multi-hop ssh from the vscode gui.

SchoofsKelvin commented 2 years ago

You can add multiple workspace folders, i.e. one for each SSH config, allowing you to access the files (and spawn terminals) on both servers. You can access the file systems and terminals of multiple configs at the same time.

The settings UI, that allows you to edit configs, also allows you to specify a proxy to use. One of the proxy types supported is SSH hopping (#7, although the GUI can now also configure it) which will spawn a SSH session for the hop, then create a tunnel through it to your target server. Your connection will look like Code <-> Hop <-> Remote.

If your hop is also configured to use a hop, you can do e.g. Code <-> Hop1 <-> Hop2 <-> Remote.

AlexEvansRaven commented 2 years ago

Hey, sorry to comment on this issue but I wasn't sure it warranted a new one as it's highly related. That's awesome to hear that ssh hopping is supported, though, for future readers, would you consider updating the readme with the example settings blob in https://github.com/SchoofsKelvin/vscode-sshfs/issues/7 ? That made it really clear to me how it functions and may be useful to others looking to configure ssh hops too! Great tool btw.

SchoofsKelvin commented 2 years ago

The README already mentions the "hop" JSON property (although you're intended to use the UI instead of directly editing the JSON) and talks about SSH Hopping under the Proxy settings section.

AlexEvansRaven commented 2 years ago

Ah, I see. The "TO DO" is quite misleading there. I assume that is for field population then, but typing it in still works fine? image

SchoofsKelvin commented 2 years ago

That's indeed an unfinished feature in the UI. But yes, typing the name of another config (exact name, and not label) will still work.