Commands

Link

Creates shareable links

rclone link

Generates public links to files in your cloud storage, if the provider supports it.

ProviderDetails
1Fichier✓
Amazon S3 & compatiblePre-signed URLs
Azure BlobSAS tokens
Backblaze B2✓
Box✓
Dropbox✓
Files.com✓
Gofile✓
Google Drive✓
Internet Archive✓
Jottacloud✓
Koofr✓
Mail.ru Cloud✓
Mega✓
OneDrive✓
pCloud✓
PikPak✓
Pixeldrain✓
premiumize.me✓
Seafile✓
Storj✓
SugarSync✓
Yandex Disk✓

Quick start

Single File

# Get link for one file
rclone link gdrive:Documents/report.pdf

# Output:
# https://drive.google.com/file/d/ABC123.../view?usp=sharing

Multiple Files

# Get links for multiple files
rclone link remote:file1.jpg remote:file2.pdf remote:file3.zip

# Each link on a new line

With Expiration

# Set expiry time (if provider supports)
rclone link remote:sensitive-file.pdf --expire 1h
rclone link remote:weekly-report.xlsx --expire 7d
rclone link remote:temporary.zip --expire 30m

Revoke Access

To revoke a link, you usually need to:

# Option 1: Use --unlink
rclone link remote:shared-file.pdf --unlink # Not all providers support this

# Option 2: Delete the file
rclone delete remote:shared-file.pdf # Permanent deletion

# Option 3: Move the file
rclone move remote:shared-file.pdf remote:shared-file-private.pdf # Renames the file

# Option 4: Change permissions in provider's web UI

Usage

Google Drive

# Get view link
rclone link gdrive:file.pdf

# For folders (creates viewable folder link)
rclone link gdrive:SharedFolder/

# Note: Respects file permissions in Drive

Dropbox

# Get download link
rclone link dropbox:file.zip

# Raw link (direct download)
rclone backend copylink dropbox:file.zip

OneDrive

--onedrive-link-type embed returns an embed link, which opens Office files in Office Online instead of the standard sharing page.

# Standard sharing link
rclone link onedrive:document.docx

# Embed link for Office files
rclone link onedrive:document.docx --onedrive-link-type embed # Opens in Office Online

S3 (Pre-signed URLs)

# Generate pre-signed URL with expiry
rclone link s3:bucket/file.zip --expire 1h

# Default expiry is 1 hour for S3

Troubleshooting

"Operation not supported"

Provider doesn't support public links:

# Check provider capabilities
rclone backend features remote:

# Workaround 1: Use rclone serve
rclone serve http remote:path --addr :8080

# Workaround 2: Copy to supported provider
rclone copy remote:file supported-remote:temp/
rclone link supported-remote:temp/file

Expiry Not Supported

#!/bin/bash
# Manual expiry with cron

# Generate link
LINK=$(rclone link remote:temp-file.pdf)
echo "$LINK" > /tmp/active-links.txt

# Schedule deletion
echo "rclone delete remote:temp-file.pdf" | at now + 24 hours

# Or with cron
(crontab -l; echo "0 0 * * * rclone delete remote:temp-file.pdf") | crontab -
# Check file still exists
rclone ls remote:file.pdf

# Check permissions
# May need to enable sharing in provider's UI

# Try regenerating
rclone link remote:file.pdf

Expiry Not Working

Not all providers support expiring links, check the provider documentation to make sure.

Google Drive

No expiry support

S3

Expiry supported

Dropbox

Limited expiry options


A public link gives anyone who has the URL access to the file. Consider privacy and security before sharing one.

See the in-depth documentation for more info.

How is this guide?