# Share a file safely

Sharing a file means giving someone else a way to read it. This guide shows how to give exactly as much access as you intend.

## Choose the link

| You want | Use |
|---|---|
| Anyone with the URL can read it | A public link |
| Only people who know a secret | A private link with a passphrase |
| Only specific FuzzyShare users | A private link with an allow-list of fingerprints |
| One person, one time | Add `--max-downloads 1` |

## A public link

```sh {tab="CLI"}
fuzzy share notes.md --ttl 2h
```

```sh {tab="curl"}
curl -H "Authorization: Bearer $FUZZY_KEY" \
  -X POST "https://fuzzyshare.com/files/notes.md/share?ttl=2h"
```

Send the URL. Public links are read-only, and they stop working when the file expires or is replaced.

## A private link with a passphrase

```sh {tab="CLI"}
FUZZY_PASSPHRASE="correct horse battery" fuzzy share report.pdf --private
```

```sh {tab="curl"}
curl -H "Authorization: Bearer $FUZZY_KEY" -X POST https://fuzzyshare.com/files/report.pdf/share \
  -d '{"access":"private","passphrase":"correct horse battery"}'
```

Send the URL and the passphrase **through different channels**. Environment variables keep the passphrase out of the process list, which a `--passphrase` flag does not.

## Allow specific keys

Ask your colleague for the fingerprint of their access key. They find it under **Keys** in their dashboard, or with `fuzzy keys ls`. It looks like `sha256:9f2c4ab01d3e7f58`. Fingerprints are safe to send: they identify a key but cannot be used as one.

```sh
fuzzy share report.pdf --allow sha256:9f2c4ab01d3e7f58 --label "for Sam"
```

They read it with their own key:

```sh
fuzzy fetch https://fuzzyshare.com/s/TOKEN
```

## Burn after reading

```sh
fuzzy share secret.txt --passphrase "correct horse battery" --max-downloads 1
```

After one read the link answers `404`.

## Check who opened it

```sh
fuzzy activity l_0123456789ab
```

See [Access activity and privacy](concepts-activity.md) for what is recorded.

## Revoke

```sh
fuzzy links              # find the id
fuzzy unshare l_0123456789ab
```

> [!WARNING]
> Anyone who already downloaded a file keeps their copy. Revoking stops future reads only.
