tensorchord / vscode-envd

vscode extension for envd
https://marketplace.visualstudio.com/items?itemName=tensorchord.vscode-envd
Apache License 2.0
2 stars 4 forks source link

feat: envd-vscode not fit for SSH-remote #19

Closed cutecutecat closed 1 year ago

cutecutecat commented 1 year ago

When a user want to attach a remote SSH when envd is instaleed remote and VSCode is installed local, he will find he has no secret key at local to access remote environment.

We will provide a command:

And these fix to enable remote access:

cutecutecat commented 1 year ago

Won't fix due to:

A --> B --> C

A: local machine, with VSCode editor installed B: remote server, with envd, VSCode server and vscode-envd extension installed C: environment constructed by envd

SSH key of C is at B SSH key of B is at A

VSCode SSH-Remote installed extension cannot access local machine file system, so it's impossible to download key or revise ./ssh/config.

ref: https://github.com/microsoft/vscode-remote-release/issues/7182

OpenSSH don't have a implement. We need to maintain a command that may fail at any time.

ref: https://serverfault.com/questions/337274/ssh-from-a-through-b-to-c-using-private-key-on-b

VoVAllen commented 1 year ago

Two options to access container at remote:

Basically I don't think we need the key of B. And vscode can do remote SSH + attach to the container at the remote. But I don't know how it is done

cutecutecat commented 1 year ago

Two options to access container at remote:

  • Port forward remote container port 2222 to local. The port-forward part is handled by user. We only need to get the key of the envd container
  • Use JumpHost of ssh, you add a JumpHost entry in local ssh config, which is for the remote machine.

Basically I don't think we need the key of B. And vscode can do remote SSH + attach to the container at the remote. But I don't know how it is done

Though Dev containers installed locally, it actually runs at remote when SSH is connected. It is not same with most extensions, and could get around VSCode Local/Remote contrictions. So I think we could introduce Dev containers as a workaround to connect when we checked extension running at a remote.