Skip to content
Console

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 C

Create 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.

Save the first key

After creation, the dialog shows an Access Key and a Secret Key. Click the copy icon next to them to save.

"密钥仅可见1次,请妥善保管" (the key is visible only once, keep it safe). After you close the dialog, you can't view the Secret Key again.

Grant permissions

Click Set permissions (设定权限) in the dialog to grant the sub-user permissions. A new sub-user has no permissions by default, and until you grant some, every request returns 403 AccessDenied.

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.

Add a key

In Key management (Key 管理), click Add key (添加 Key).

Enter a note and choose the sub-user

  • Note (备注): Required. Describe the purpose, for example "Website server".
  • Sub-user (子用户): Choose the sub-user it belongs to.

Confirm and save

Click OK (确定) and copy the Access Key and Secret Key that appear.

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

SettingValue
Endpointhttps://s3.bitiful.net
Regioncn-east-1
Access Key IDThe Access Key from the console
Secret Access KeyThe 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.

Replace

Swap the keys in your business configuration for the new ones and confirm that requests work.

Delete the old key

Delete the old key in Key management.

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

ActionEffect
Delete a keyPrograms using it immediately lose access. The sub-user and its other keys are unaffected
Delete a sub-userAll 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.