# Public and private links

A **link** lets someone else read a file. Links are read-only, hide the file's name, and never outlive the file.

## Public links

Anyone with the URL can read the file. No account is needed.

```sh
fuzzy share report.pdf --ttl 1h
```

Public links answer `GET` and `HEAD` only. They are pinned to the version of the file they were made for: replacing or deleting the file revokes them.

## Private links

A private link shows nothing, not even the file's name, until the reader proves access. There are two proofs, and a link can use either or both:

- A **passphrase** of 8 to 200 characters. Tell the reader out of band.
- An **allow-list** of key fingerprints (up to 20). The reader presents their own access key, and its fingerprint must be on the list.

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

FuzzyShare keeps only hashes of private links. The URL is shown **once**, when you make it.

## Limits on a link

| Option | Meaning |
|---|---|
| `ttl` | Shorter than the file's remaining life |
| `max_downloads` | 1 to 1000. The link stops working after that many reads ("burn after reading") |
| `label` | A note for yourself, up to 60 characters |

A file can have 20 active links and a person 200.

## What counts as a read

A request that serves the bytes counts as one read. Previews, `/info` and `HEAD` never count. A browser that opens the preview and then presses Download counts once: the first counted request sets a short cookie that makes the next ones free for 10 minutes. Programs without the cookie count every read.

When the limit is reached, the link answers `404`, like an expired one.

## Turning public links off

An operator can set `FUZZY_ALLOW_PUBLIC=false`. Then every link must be private. See the [configuration reference](self-hosting-configuration.md).

For the exact requests, see [Links in the API](api-links.md).
