Sub-users and AccessKeys
When code, Rclone, image hosting apps, a NAS, or other tools connect to S4, they need an AccessKey and a SecretKey. A key belongs to a sub-user, and what it can do is determined by the sub-user's permissions. Keys have no separate permissions of their own.
Sub-users and keys are managed under Object Storage (对象存储) › Sub-users & Keys (子账户&Key).
Primary account
├─ Sub-user web Permissions: read, write, list on bucket my-bucket
│ ├─ Key A Used by the production server
│ └─ Key B Used by the staging server
└─ Sub-user backup Permissions: write, list on bucket my-backup
└─ Key CCreate a sub-user
Add a sub-user
Click Add sub-user (添加子用户) and enter a Sub-user name (子用户名): 3 ~ 12 characters, English letters or digits only, unique within the account, and can't be changed after you add it.
Prerequisites: identity verification is complete (otherwise you see "请先完成实名认证", meaning please complete identity verification first), and the account has no overdue balance (otherwise you see "您当前已欠费,请先充值", meaning you are overdue, please top up first).
Add a key to an existing sub-user
A sub-user can have multiple keys, all with identical permissions. We recommend using a separate key for each server and application so you can disable them individually.
In the Key management table, the Secret Key column always shows asterisks. The first key generated when you create a sub-user has the note -, and you can click Edit note (修改备注) to fill it in. Notes don't affect usage.
Use in tools
| Setting | Value |
|---|---|
| Endpoint | https://s3.bitiful.net |
| Region | cn-east-1 |
| Access Key ID | The Access Key from the console |
| Secret Access Key | The Secret Key from the console |
For examples in each language, see SDKs. For the command line, see AWS CLI / s5cmd and Rclone.
Rotate keys
When you replace keys regularly, or suspect a leak, follow this order to avoid interrupting your business:
Create
Add a key for the same sub-user. It automatically has the same permissions, so you don't need to grant them again.
If a key has already leaked, delete the old key first, then restore your business. Presigned URLs generated with the old key also stop working.
Delete
| Action | Effect |
|---|---|
| Delete a key | Programs using it immediately lose access. The sub-user and its other keys are unaffected |
| Delete a sub-user | All of its AccessKeys and all bucket and directory grants are deleted immediately and can't be recovered |
Deleting a sub-user doesn't delete the files it uploaded. The files belong to the primary account.
Security recommendations
- Don't put a SecretKey in a web page, mini program, app, or public repository. For uploads from browsers, use presigned URLs.
- Split sub-users by workload and grant only the buckets and directories they need.
- For services that only read, don't select "write", because "write" includes delete.
FAQ
I forgot to save the Secret Key
It can't be recovered. Add a new key, then delete the old one.
Can I connect S3 tools with my login password?
No. Only a sub-user's AccessKey works.
What's the difference between an AccessKey and an API Token?
An AccessKey is for the S3 protocol and reads and writes files in buckets. An API Token is for calling Bitiful's management APIs, such as querying usage or purging the CDN cache. They aren't interchangeable.
The tool says I don't have permission to create a bucket
Sub-users can't create buckets. Create it in the console first. For Rclone, you can add no_check_bucket = true to skip the check.