# Workstation and Secret sharing

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> Share a workstation or a Secret you own with a teammate, see who has access, and stop sharing.


Workstations and Secrets are personal. You own what you create. Peers can `get` and `list` your objects, but they cannot update or delete them, connect to them with SSH, or read their values. To let someone else in, you create a [Grant](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/roles-grants/#grants), and the `share` and `unshare` commands create and delete Grants for you.

If you own a service account, you share what that account owns the same way, with no extra flag. Every flag and example is in the [Shares and access](https://docs-stg.ringleader.dev/reference/cli/commands/shares-access/) reference.

## Rights a share grants

Sharing a workstation gives the person SSH access. That covers `rl shell`, `rl tmux` and standard `ssh`. Ringleader adds the person's node keys to the workstation's authorized keys.

A share does not forward the person's own SSH keys into the workstation, as [Keys for outbound connections](https://docs-stg.ringleader.dev/workstations/connectivity/git-ssh-keys/#keys-for-outbound-connections) explains. It forwards the workstation's ports to their computer only if you opt in, as [Forwards on a shared workstation](https://docs-stg.ringleader.dev/workstations/connectivity/port-socket-forwarding/#forwards-on-a-shared-workstation) explains. It never carries a service on their computer into the workstation.

Sharing a Secret gives the person the `access` right: the right to read its values and to admit objects that consume it. [Secret sharing](https://docs-stg.ringleader.dev/security/credentials/secret-handling/#secret-sharing) says which shapes of Grant are refused or accepted for a Secret.

Sharing a workstation pool gives the person the `lease` right, which opens the pool and not its members. [Access for a lease holder](https://docs-stg.ringleader.dev/workstations/lifecycle/pools-leases/#access-for-a-lease-holder) says what a holder can do.

### Workstations that cannot be shared

A [node-bound workstation](https://docs-stg.ringleader.dev/workstations/basics/#node-bound-workstations) cannot be shared. It runs on your computer, which no one else's computer can reach, so a Grant that names only that workstation is refused.

## Share a workstation

Share a workstation when a teammate needs a shell in it.

1. Run `rl workstation share my-box --with user:alice@acme.com`. Ringleader creates the Grant, and Alice can then connect to `my-box`.
2. Optional: to add more people, repeat `--with`, as in `--with user:alice@acme.com --with sa:dev/ci`.
3. Optional: to share every workstation you own, use `--all` in place of the name.

To check the Grant before you apply it, add `--dry-run`. It prints the Grant and creates nothing.

A namespace administrator adds `--admin` to share a workstation they do not own, or anything a service account in the namespace owns. [Grant scope](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/roles-grants/#grant-scope) says what each scope reaches.

## Share a Secret

Share a Secret when a teammate or a service account needs to read its values.

Run `rl secret share db --with user:alice@acme.com`. Alice can then read the value of `db` with `rl secret get db --reveal`. To share every Secret you own with a service account, run `rl secret share --all --with sa:dev/builder`.

## See who has access

Report who can reach a workstation, and through which Grant or through ownership, with `rl workstation access my-box`. For a Secret, `rl secret access db` reports who can read its value.

To list the shares you created and the shares provided to you, run `rl share show`. Narrow the list with `--mine`, `--to-me`, `--enabled` or `--disabled`.

## Stop sharing

Stop sharing when a teammate no longer needs access. Run the matching `unshare` command and name the same target and people the share used:

```bash
rl workstation unshare my-box --with user:alice@acme.com
rl secret unshare db --with user:alice@acme.com
```

The command deletes the Grant. You can only revoke a share you created. To pause a share and resume it later, run `rl share disable workstation my-box --with user:alice@acme.com`, and then `rl share enable` with the same arguments.

## Next steps

- [Shares and access](https://docs-stg.ringleader.dev/reference/cli/commands/shares-access/): every flag of the `share`, `unshare`, `access` and `share show` commands.
- [Roles and grants](https://docs-stg.ringleader.dev/organizations-teams/accounts-access/roles-grants/): what a Grant is and what each scope reaches.
- [Pools and leases](https://docs-stg.ringleader.dev/workstations/lifecycle/pools-leases/): lease a member of a pool that someone shared.

