mc admin accesskey edit
The mc admin accesskey edit command modifies the configuration of an access key associated to the specified user.
The command requires that at least one attribute of the access key change. Otherwise, the command exits with an error message.
Syntax
The following command applies a new policy and secret key to the myuserserviceaccount access key on the myaistor deployment:
mc admin accesskey edit \
myaistor myuserserviceaccount \
--secret-key "myuserserviceaccountnewsecretkey" \
--policy "/path/to/new/policy.json"The command has the following syntax:
mc [GLOBALFLAGS] admin accesskey edit \
ALIAS \
ACCESSKEY \
[--description string] \
[--expiry-duration value] \
[--expiry value] \
[--name string] \
[--policy path] \
[--secret-key string]- Brackets
[]indicate optional parameters. - Parameters sharing a line are mutually dependent.
- Parameters separated using the pipe
|operator are mutually exclusive.
Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.
Parameters
ALIAS
Required
The alias of the MinIO AIStor deployment.
ACCESSKEY
Required
The access key to modify.
--description
Optional
Add or modify a description for the access key. For example, you might specify the reason the access key exists.
--expiry
Optional
The future date and time when the access key expires. The access key becomes invalid at the start of the specified date and time (midnight if no time is specified).
Supported formats:
| Format | Example | Description |
|---|---|---|
YYYY-MM-DD | 2030-12-31 | Expires at midnight (00:00:00) on the specified date |
YYYY-MM-DDTHH:MM | 2030-12-31T23:59 | Expires at the specified date and time |
YYYY-MM-DDTHH:MM:SS | 2030-12-31T23:59:59 | Expires at the specified date, time, and seconds |
| RFC3339 | 2030-12-31T23:59:59Z | Expires at the specified UTC time |
Dates without a timezone use the local timezone of the machine running the command.
Use RFC3339 format with Z suffix or timezone offset for explicit UTC times.
Mutually exclusive with --expiry-duration.
--expiry-duration
Optional
Length of time for which the accesskey remains valid.
For example, 30d, 24h, or similar.
To expire the credentials after 30 days, use:
--expiry-duration 30dMutually exclusive with --expiry.
--name
Optional
Add or modify a human-readable name for the access key.
--policy
Optional
The path to a policy document to attach to the new access key, with a maximum size of 4096 bytes. The attached policy cannot grant access to any action or resource not explicitly allowed by the parent user’s policies.
The new policy overwrites any previously attached policy.
--secret-key
Optional
The secret key to associate with the new access key. Overwrites the previous secret key. Applications using the access keys must update to use the new credentials to continue performing operations.
Global Flags
This command supports any of the global flags.
Examples
Change the secret key for an access key
The following command modifies the secret key for the access key myuseraccesskey on the myaistor deployment.
mc admin accesskey edit myaistor/ myuseraccesskey --secret-key 'new-secret-key-change-me'Change the expiration for an access key
The following command changes the expiration value for the access key myuseraccesskey on the myaistor deployment.
mc admin accesskey edit myaistor/ myuseraccesskey --expiry-duration 24hYou cannot use --expiry-duration and --expiry in the same command.
Behavior
S3 compatibility
This command uses a MinIO AIStor administrative API and does not work against other S3-compatible services.