You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Sharing attach access with other users #3892
Only the user that started the run can attach to it. Often, it can be useful to share attach access with other users. For example, to collaborate in a dev environment, or to perform maintenance on a production service.
Solution
Allow to configure who can attach to the run in the run configuration.
# This is an example, the exact syntax is to be discussedattachable_by:
# the specified usersusers:
- alice
- bob# all project members, current and futureproject_members: true# anyone who can provide a valid private key in `dstack attach --ssh-identity`public_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC3W5mKq8x8mQqQ5tZ7f9uY2G9wYx2YV3dK0wQ8pL7xM user@example"
The default is equivalent to:
attachable_by:
users:
- "<run owner>"
Specifying --ssh-identity in dstack apply is equivalent to:
attachable_by:
public_keys:
- "<public key of the key pair from --ssh-identity>"
Run owners and project admins are allowed to update the policy in-place.
Implementation notes
Granting SSH access can be implementing by delivering all authorized users' keys, either server-generated (#3176) or user-provided (#3688), to shim and runner, or exposing them to the SSH proxy. Shim and runner should be able to handle updates of authorized keys in case the policy or project membership change mid-run.
Workaround
Manage SSH keys manually.
Generate a key pair and share it with all authorized users.
Start the run with dstack apply --ssh-identity <path-to-private-key>.
Attach to the run with dstack attach <run-name> --ssh-identity <path-to-private-key>.
The workaround does not support sharing access to existing runs (in-place update).
Would you like to help us implement this feature by sending a PR?
Activity
github-actions commentedon Jun 21, 2026
This issue is stale because it has been open for 30 days with no activity.
github-actions commentedon Jul 6, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale. Please reopen the issue if it is still relevant.