Minio : Some usefull commands…

Introduction

Minio is a cloud native open-source object storage solution (S3 compatible). Here, you can found some usefull commands to administrate your Minio instance.

Start ‘mc’ command by using Docker command :

# docker run -it --rm -entrypoint=/bin/sh minio/mc:<TAG>
docker run -it --rm -entrypoint=/bin/sh minio/mc:RELEASE.2019-09-11T19-53-16Z

Warning : Be careful when you choose minio/mc tag. Please, choose tag timestamp equal to the minio server.

Login to minio instance :

# mc config host add <ALIAS> <YOUR-S3-ENDPOINT> <YOUR-ACCESS-KEY> <YOUR-SECRET-KEY> <API-SIGNATURE>
mc config host add minio https://minio.myhostingservice.com/ admin <YOUR-SECRET-KEY>

List all Minio buckets :

# mc ls <minio_alias>
mc ls minio

List Minio users :

# mc admin user list <minio_alias>
mc admin user list minio

List Minio policy :

# mc admin policy list <minio_alias>
mc admin policy list minio

Create Minio policy :

  • Create <your-policy>.json file (this is an example)
{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Sid":"yourapp",
         "Effect":"Allow",
         "Action":[
            "s3:*"
         ],
         "Resource":[
            "arn:aws:s3:::yourapp/*"
         ]
      }
   ]
}
  • Apply your policy on minio instance
# mc admin policy add <alias_minio> <policy> <policy>.json
mc admin policy add minio mysuperproject mysuperproject.json

Add Minio user :

# mc admin user add myminio <user> <password>
mc admin user add myminio newuser newuser123

Apply Minio policy on user :

# mc admin policy set <minio_alias> <policy> user=<user>
mc admin policy set minio mysuperproject user=newuser

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.