Welcome to the upcoming version of the MinIO Documentation! The content on this page is under active development and may change at any time. If you can't find what you're looking for, check our legacy documentation. Thank you for your patience.

mc alias

Description

The mc alias command provides a convenient interface for managing the list of S3-compatible hosts that mc can connect to and run operations against.

mc commands that operate on S3-compatible services require specifying an alias for that service.

Using mc alias to add or remove an S3-compatible host is equivalent to manually editing entries in the mc configuration file.

Required Credentials and Access Control

mc alias requires specifying an access key and corresponding secret key for the S3-compatible host. mc functionality is limited based on the policies associated to the specified credentials. For example, if the specified credentials do not have read/write access to a specific bucket, mc cannot perform read or write operations on that bucket.

For more information on MinIO Access Control, see Access Management.

For more complete documentation on S3 Access Control, see Amazon S3 Security.

For all other S3-compatible services, defer to the documentation for that service.

Examples

Add an S3-Compatible Service

Use mc alias set to add an S3-compatible service for use with mc:

mc alias set ALIAS HOSTNAME ACCESSKEY SECRETKEY
  • Replace ALIAS with the alias to associate to the S3-compatible service.

  • Replace HOSTNAME with the hostname or IP address of the S3-compatible service.

  • Replace ACCESSKEY and SECRETKEY with the access and secret key for a user on the S3-compatible service.

Remove a Configured S3-Compatible Service

Use mc alias remove to remove an S3-compatible alias from the mc configuration:

mc alias remove ALIAS
  • Replace ALIAS with the alias of the S3-compatible service to remove.

Use mc alias list to list the currently configured aliases and their associated S3-compatible service.

List Configured S3-Compatible Services

Use mc alias list to list all configured S3-compatible aliases:

mc alias list

Syntax

mc alias set, s

Adds a new S3-compatible host to the configuration file. The command has the following syntax:

mc alias set ALIAS HOSTNAME ACCESSKEY SECRETKEY --api [S3v2|S3v4]

mc alias set supports the following arguments:

ALIAS

Required The name to associate to the S3-compatible service.

The specified string cannot match any existing host aliases. Use list to view the current host aliases before adding a new host.

HOSTNAME

Required The URL for the S3-compatible service endpoint.

ACCESSKEY

Required The access key for authenticating to the S3 service. The ACCESSKEY must correspond to a user or role on the S3 service.

mc can only perform an operation on the S3 service if the ACCESSKEY user or role grants the required permissions.

SECRETKEY

Required The corresponding secret for the specified ACCESSKEY.

--api

Optional The Amazon S3 Signature version to use when connecting to the S3 service. Supports the following values:

  • S3v2

  • S3v4 (Default)

mc alias remove, rm

Removes a host entry from the configuration file. The command has the following syntax:

mc alias remove ALIAS
ALIAS

Required The alias to remove.

Use list to validate the alias and its associated S3-compatible service before removing it.

mc alias list, ls

Lists all hosts in the configuration file. The command has the following syntax:

mc alias list