Quick Note on creating MINIO Users

Quick Note on creating MINIO Users
Photo by Lia Trevarthen / Unsplash

Hi! I want to show you how you can add new user on your minio server and how you can assign him access rights to selected folders by creating policy.

Create user

mc admin user add mystorage <NEW-USER-ACCESS-KEY> <NEW-USER-SECRET-KEY>

New users dont have any access on server, You can just login so you will need to setup policy and assign it to newly created user

Create Bucket

mc mb mystorage/my-site

Create policy.

Add this policy content to policy-name.json.

{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Action": [
          "s3:GetObject",
          "s3:PutObject",
          "s3:DeleteObject",
          "s3:GetBucketLocation",
          "s3:ListBucket",
          "s3:ListAllMyBuckets"
        ],
        "Effect": "Allow",
        "Resource": [
          "arn:aws:s3:::my-site/*"
        ],
        "Sid": "Public"
      }
    ]
  }

Install policy to server

mc admin policy add mystorage policy-name policy-name.json

Assign policy to user

mc admin policy set mystorage "policy-name" user=<NEW-USER-ACCESS-KEY>

That's all!