# Share access, or use someone's

Let someone you trust use the models on your machine, or use a machine someone shared with
you. Access goes one way: sharing yours gives you nothing of theirs, and accepting theirs
shares nothing of yours.

## Share your machine with someone

1. **Check who already has access, then turn sharing on.** In [Sharing](/sharing), look under
   **You share with**: everyone who has accepted there can use this machine once sharing is on. Then,
   in [Machines](/machines), open the machine and use the switch beside **Sharing is off**.
   If you share with no one yet, the page says **No one else has access yet.**
2. **Invite them.** In [Sharing](/sharing), choose **Invite someone**.
   - **One person**: enter their address under **Send to**, add a **Name or note** only you
     see, and choose **Send invitation**. It works once.
   - **A lab, team or class**: set **How many people can accept**, add a note, choose
     **Create link**, then **Copy link** and pass it on. People who accept the same link
     cannot use each other's machines.

   Choose how long it lasts under **Expires after**: 1, 3 or 7 days.
3. **Optionally, set hours.** **Edit schedule** on the machine's page limits when the people
   you share with can use it. A schedule holds at most 5 periods
   ([Set up Saylek for a team](/docs/set-up-for-a-team) explains).

From the terminal:

```bash
saylek sharing invite --note "Rana" --email rana@example.com
saylek sharing invite --note "Lab, autumn term" --link --uses 5 --expires 7d
```

**You know it worked when** they appear under **You share with** in [Sharing](/sharing), and
the machine's page says they can use its idle capacity.

## Use a machine someone shared with you

1. Open the invitation: **Review invitation** in the email, or the link you were given.
2. Sign in, or create an account. Signing in does not accept: you come back to the offer.
3. Choose **Accept invitation**.
4. If the page says models are available now, choose **See available models**, then connect an application
   in [Applications](/applications) with **Add application** and **Create key**, as in
   [Connect your app](/docs/connect-your-app).

   If it says **No models are available right now.**, your access is in place but nothing
   is shared yet: the owner's machine may be off, paused or outside its hours. Ask them, and
   check [Applications](/applications) later. If the page shows only **Go to Applications**,
   open it to check. You can create a key now, but it has nothing to call until models appear.

From the terminal, check the offer first, then accept it:

```bash
saylek sharing preview <invitation>
saylek sharing accept <invitation>
```

**You know it worked when** the page says **Access accepted.** Their models appear in the
models list for your key when they are shared and available. The machine that serves a request reads it in the clear: read
[Privacy and egress](/docs/privacy-and-egress) before you send it sensitive work.

## Change or end access

| To | In the web | From the terminal |
|---|---|---|
| See who has access, both ways | [Sharing](/sharing) | `saylek sharing list` |
| Pause one person | **Pause** on their page in Sharing | Web only |
| End one person's access | **Remove** followed by their name, on their page | `saylek sharing revoke --person <name>` |
| Cancel an invitation nobody has used | **Withdraw** or **Revoke** beside it in Sharing | Web only |
| Stop using someone's machines | **Stop using their compute** on their page | `saylek sharing stop-using --person <name>` |

A pause, or a new person, can take up to a minute to apply.

## If something goes wrong

| What you see | What to do |
|---|---|
| `This invitation is no longer valid.` | It expired, or was used up or withdrawn. Ask for a new one |
| `This invite has been used up.` | Ask the person who sent it for a new one |
| `that invitation cannot be used` (terminal) | Same: ask for a new invitation |
| `Add your own name in your account first` | Set your name in [Account](/account), then invite again |
| `We cannot send email right now` | Choose **A lab, team or class** and send the link yourself |
| They accepted, but your machine's page still says no one has access | Check sharing is on for that machine, and give it up to a minute |

## Reference

- [Sharing and access](/docs/sharing-and-access): every sharing command.
- [Invite flow](/docs/invite-flow): what the person you invite sees.
- [Set up Saylek for a team](/docs/set-up-for-a-team): sharing for a whole team.
