mc admin accesskey create
The mc admin accesskey create
command adds a new access key and secret key pair for an existing AIStor user.
Syntax
Parameters
ALIAS
Required
The alias
of the AIStor deployment.
USER
Optional
The username of the user to which AIStor adds the new access key. If not specified, AIStor generates an access key/secret key pair for the authenticated user.
--access-key
Optional
A string to use as the access key for this account. Omit to let AIStor autogenerate a random 20 character value.
Access Key names must be unique across all users.
--description
Optional
Add a description for the access key. For example, you might specify the reason the access key exists.
--expiry
Optional
Set an expiration date for the access key. The date must be in the future. You may not set an expiration date that has already passed.
Allowed date and time formats:
2024-10-24
2024-10-24T10:00
2024-10-24T10:00:00
2024-10-24T10:00:00Z
2024-10-24T10:00:00-07:00
Mutually exclusive with --expiry-duration
.
--expiry-duration
Optional
Length of time for which the accesskey remains valid.
For example, 30m, ``24h
, 30d
, or similar.
The following expires the credentials after 30 days:
--expiry-duration 30d
Mutually exclusive with --expiry
.
--name
Optional
Add a human-readable name for the access key.
--policy
Optional
The readable path to a policy document to attach to the new access key, with a maximum size of 2048 characters. The attached policy cannot grant access to any action or resource not explicitly allowed by the parent user’s policy or group policies
--secret-key
Optional
The secret key to associate with the new account. Omit to let AIStor autogenerate a random 40-character value.
Global Flags
This command supports any of the global flags.
Examples
Create access key / secret key pair for the authenticated user
The following command generates a new, random access key and secret key pair for the user currently logged in to AIStor deployment at the alias myminio
.
The access key and secret key have the same access policies as the authenticated user.
mc admin accesskey create myminio/
Create a custom access key / secret key pair for the authenticated user
The following command creates a new access key and secret key pair for the user currently logged in to AIStor at the alias myminio
.
The access key and secret key have the same access policies as the authenticated user.
mc admin accesskey create myminio/ --access-key myaccesskey --secret-key mysecretkey
Create an access key / secret key pair for another user with limited duration
The following command creates a new access key and secret key pair for a user, miniouser
on the alias myminio
.
The access key and secret key have the same access policies as miniouser
.
The credentials remain valid for 24 hours after creation.
mc admin accesskey create myminio/ miniouser --expiry-duration 24h
Create access key / secret key pair for the authenticated user that expires
The following command generates a new and random access key and random secret key pair for the user currently logged in to AIStor deployment at the alias myminio
.
The access key and secret key have the same access policies as the authenticated user.
The credentials expire on the fifteenth day of January, 2025.
mc admin accesskey create myminio/ --expiry 2025-01-15
The date specified must be a future date.
For valid datetime formats, see the --expiry
flag.
Create access key / secret key pair for a different user with custom access
The following command creates a new access key and secret key pair for the user, miniouser
on the alias myminio
.
The access key and secret key have a more limited set of access than miniouser
, as specified in the policy JSON file.
mc admin accesskey create myminio/ miniouser --policy /path/to/policy.json
The specified policy file must not grant access to anything to which miniouser
does not already have access.
Behavior
S3 Compatibility
The mc commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.
AIStor provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported. While mc commands may work as documented, any such usage is at your own risk.