In this article
Documentation reviewed, not lab tested. The steps and commands come from the vendor documentation cited at the end. We have not run them. Try them on a test system first.
The default
Link sharing is easy to switch on and easy to leave loosely configured. Nextcloud's admin documentation says the Allow users to share via link and email option lets people who are not Nextcloud users open shared files through a hyperlink. According to the documentation, the password option beside it, Always ask for a password, only prompts the user to set one. It is a prompt, not enforcement.
Why it bites
A public link needs no Nextcloud account, so the link is the access check unless a password sits on top of it. Per the documentation, enforcement is a separate setting called Enforce password protection. It covers public links only, not local user and group shares.
Expiry is softer than it looks. Users can extend a share's expiration date later, and because the date counts from today rather than from creation, a link can be renewed whenever the old date gets close. The documentation says the Allow public uploads option goes further: it lets anyone upload files to public shares.
How to check
Open the Sharing section of the Admin page, where Nextcloud keeps its sharing policy, and look at each of these:
- Password: per the documentation, confirm Enforce password protection is on, since Always ask for a password only prompts.
- Expiry: see whether a default expiration date is set and whether the Enforce expiration date option, as the documentation describes it, makes it mandatory for public shares.
- Uploads: see whether the Allow public uploads option is ticked.
- Groups: see which groups the documentation's Exclude groups from creating link shares setting lists.
These checks read policy, not the links that already exist. Treat the result as what new shares will look like.
The fix
The commands below come from the Nextcloud documentation listed under Sources. Check them against your own install before running them. Turn on the Enforce password protection setting, as the documentation describes it.
The cost is that users must set a password on every public link. Turn on the Enforce expiration date setting. Users then cannot set an expiry later than the enforced date, though they can choose an earlier one.
To keep a short default under a longer ceiling, set the enforced date in the settings, then lower the default with occ:
occ config:app:set --value <DAYS> core link_defaultExpDayssets the default for link shares.occ config:app:set --value <DAYS> core internal_defaultExpDayssets it for local user shares.
The documentation's own example is a 7-day default with a 14-day maximum. Untick the Allow public uploads option if nobody needs it, which ends anonymous uploads to public shares. If you keep uploads, the documentation says the Show disclaimer text on the public link upload page option sets a disclaimer on links with hidden file lists.
For people who should not publish links at all, the documentation's Exclude groups from creating link shares setting stops the groups you name. The Exclude groups from sharing setting is broader: members cannot create any shares, but they can still receive them. The blunt option is unchecking the Share API setting, which means no users can create file shares.
When someone leaves, occ files:transfer-ownership user1 user2 moves their files, shares and metadata such as tags and comments to another user. Trashbin contents do not move.
Friday checklist
- Switch password enforcement on, not just the prompt.
- Enforce an expiry and set a shorter default under it.
- Turn off public uploads unless a workflow needs them.
- Look through your most-shared folders by hand for links you no longer recognise.
What the sources don't cover
The admin sharing documentation describes controls for passwords, expiry, uploads and group exclusions, and says nothing about previews, EXIF data or display names. So this column makes no claim about thumbnails, location metadata or what name a public link page shows. Test that on your own instance. The sources we used also give no default values, no versions, and no way to audit existing shares, so verify those against your install.
Sources
Image: “Padlocks” by dickinsonjohn02, Public Domain Mark, via flickr (Openverse)
This story was produced with AI assistance from the sources listed above and fact-checked against them before publication. Read our editorial methodology and the corrections log. Spotted an error? Email [email protected].

Discussion