Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Allow a user to attach to runs from different machines #2053

Open
jvstme opened this issue Dec 3, 2024 · 0 comments
Open

[Feature]: Allow a user to attach to runs from different machines #2053

jvstme opened this issue Dec 3, 2024 · 0 comments

Comments

@jvstme
Copy link
Collaborator

jvstme commented Dec 3, 2024

Problem

  1. A user starts a run with dstack apply.
  2. The user switches to another computer.
  3. The user tries to attach to the run using dstack attach.

The user won't be able to attach and will get the Can't connect to the remote host error.

This happens because the SSH key for attaching is generated in CLI and stored on the machine, so different machines will have different keys, even if the user is the same.

Solution

Generate and store users' SSH keys in dstack-server and download them to the client machine when needed.
This ensures that all of a user's machines have the same key, and the only secret the user needs to access their runs from a new machine is the dstack API token.

Workaround 1

  • Generate a private+public key pair with ssh-keygen and deliver them to all machines where access to the run in desired.
  • Before running dstack apply, init the repo with dstack init --ssh-identity <path to private key>
  • To attach to the run, use dstack attach --ssh-identity <path to private key> <run name>

Workaround 2

Manually copy ~/.dstack/ssh/id_rsa and ~/.dstack/ssh/id_rsa.pub from one machine to the rest.

Would you like to help us implement this feature by sending a PR?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant