Overview
copyparty supports multiple authentication methods:- Basic authentication - Built-in username/password accounts
- IP-based authentication - Auto-login based on IP address/range
- Identity providers (IdP) - OAuth, LDAP, Active Directory, SAML
- Header-based authentication - Integration with reverse proxy auth
- User-changeable passwords - Let users manage their own passwords
Basic Authentication
Creating User Accounts
Command-line accounts
Create accounts with the Both users can access
-a flag:/files with their respective passwords.User Groups
Organize users into groups for easier management:Password Hashing
Store hashed passwords instead of plaintext:--ah-alg 6- Use bcrypt with cost factor 12- Passwords are auto-hashed on first use
User-Changeable Passwords
Let users change their own passwords:--chpw- Enable password changing- Users access via control-panel
- New passwords stored in
chpw.jsonby default
IP-Based Authentication
Auto-Login by IP Range
Automatically log in users from specific networks:- Anyone from
192.168.1.0/24auto-logs in asalice - No password prompt for those IPs
Restrict Users to IP Ranges
Limit which IPs can use an account:- User
remote-workercan ONLY login from203.0.113.0/24 - Connections from other IPs are rejected
Identity Provider (SSO) Integration
Overview
Replace copyparty’s built-in authentication with external identity providers:- Authelia - Config-file based IdP
- Authentik - GUI-based IdP with advanced features
- Keycloak - Enterprise SSO solution
- OAuth providers - Google, GitHub, etc.
- LDAP / Active Directory
- SAML providers
How It Works
- User visits copyparty
- Reverse proxy redirects to IdP login
- User authenticates with IdP
- IdP sends username via HTTP header
- copyparty reads header and grants access
Basic IdP Setup
Configure copyparty to trust a header:Authelia Integration
Complete example with Authelia IdP:Install Authelia
See Authelia documentation or use the docker-compose example.
Generic Header Authentication
Map any header to copyparty users:^HeaderName^HeaderValue^CopypartyUsername
Authentication Precedence
Control which auth method takes priority:idp,pwd- Normal operation, with password fallbackpwd,idp- Let admin override IdP with password
WebDAV Authentication
WebDAV clients often struggle with IdP authentication.Password-Based WebDAV
Force password auth for WebDAV:alice:webdav-password, but web UI uses IdP.
Separate WebDAV Port
Run WebDAV on a different port without IdP:- Port 3923: Web UI with IdP auth
- Port 3980: WebDAV with password auth (no IdP)
Session Management
Session Cookies
Reduce IdP load with session cookies:- copyparty sets a
cppwscookie - Future requests skip IdP validation
- Cookie expires after 24 hours (default)
Session Timeout
Advanced Authentication Patterns
Public Read, Authenticated Write
Multiple Auth Levels
Temporary Access
Use the shares feature for temporary authenticated access:- Custom expiration time
- Optional password
- Access to specific files/folders
Ban and Rate Limiting
Failed Login Protection
5failed attempts- In
3600seconds (1 hour) - Results in
86400second ban (24 hours)
Whitelist IPs from Bans
Complete SSO Example
complete-sso.conf
Troubleshooting
Users getting 'thank you for playing' message
Users getting 'thank you for playing' message
This means they’re banned for suspicious activity.Solutions:
- Check ban settings:
--ban-pw,--ban-404 - Configure real-IP detection:
--xff-hdr,--xff-src - Whitelist trusted IPs
- Check server logs for ban reason
IdP authentication not working
IdP authentication not working
Check these:
- Header name matches:
idp-h-usr: Remote-User - Reverse proxy sends header: check nginx/apache config
- Real-IP configured:
--xff-hdr,--rproxy - Account exists in copyparty config
- Check server logs for header values
WebDAV clients can't connect
WebDAV clients can't connect
WebDAV often incompatible with IdP.Solutions:
- Enable password auth:
dav-auth - Use separate port:
dav-port: 3980 - Set account password:
alice: webdav-pass - Check user-agent: some need
og_uaconfigured
Password changes not saving
Password changes not saving
Check:
--chpwenabled- Write permission on
chpw-dbfile (defaultchpw.json) - Account not in
chpw-nolist - Not using IdP (incompatible with
--chpw)
IP authentication not working
IP authentication not working
Reverse proxy issues:
- Configure real-IP:
--xff-hdr x-forwarded-for - Trust proxy:
--xff-src 172.16.0.0/12 - Set rproxy mode:
--rproxy -1 - Check server logs for detected IP
Security Best Practices
Use HTTPS
Always use HTTPS in production:Or use a reverse proxy with TLS.
Hash Passwords
Never store plaintext passwords:
Rate Limiting
Enable ban protection:
Least Privilege
Grant minimum required permissions:
Monitor Access
Enable logging and monitoring:
Next Steps
- Set up file sharing with authenticated users
- Configure write-only folders for submissions
- Enable deduplication to track uploaders
- Create a media server with access control