envd icon indicating copy to clipboard operation
envd copied to clipboard

feat(CLI): Support SSH(attach) command

Open gaocegege opened this issue 2 years ago • 7 comments

Description

midi ssh

gaocegege avatar May 05 '22 01:05 gaocegege

Is it done though sshd?

kemingy avatar Sep 01 '22 11:09 kemingy

This issue is to support a new command envd ssh to attach into the env.

gaocegege avatar Sep 02 '22 02:09 gaocegege

This issue is to support a new command envd ssh to attach into the env.

What's the main difference between ssh <envd-container> and envd ssh <envd-container>? Any feature we should support through this new command?

kemingy avatar Sep 02 '22 02:09 kemingy

envd ssh or envd attach does not require the target if it is run in the build context dir.

gaocegege avatar Sep 02 '22 02:09 gaocegege

For envd-server runner:

envd ssh will be introduced as the new command. It creates the ssh client config, then connect to the ssh proxy server containerssh. The username should be the contains the identitytoken and project name.

The envd-server should:

  • Get the identity token and the project name, then find the correct pod to attach.
  • Update containerssh app config with the /v1/config endpoint.

gaocegege avatar Sep 30 '22 00:09 gaocegege

After thinking, I propose not to add the command now.

We already inject the ssh entry in envd-server runner like this:

# entry generated by envd
Host a332139d39b89a241400013700e665a3.envd
  PubkeyAcceptedKeyTypes +ssh-rsa
  HostKeyAlgorithms +ssh-rsa
  HostName 127.0.0.1
  Port 2222
  UserKnownHostsFile /dev/null
  IdentityFile "/home/gaocegege/.config/envd/id_rsa_envd"
  StrictHostKeyChecking no
  User a332139d39b89a241400013700e665a3

User can use ssh a332139d39b89a241400013700e665a3.envd to attach. Thus there is no need to introduce a new command.

gaocegege avatar Oct 12 '22 01:10 gaocegege

Mainly to support automatic port forwarding other than pure SSH connection. This is also related to the syncthing support

VoVAllen avatar Jan 05 '23 09:01 VoVAllen