May's Blog

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

1mc 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

1mc mb mystorage/my-site

Create policy.

Add this policy content to policy-name.json.

 1{
 2    "Version": "2012-10-17",
 3    "Statement": [
 4      {
 5        "Action": [
 6          "s3:GetObject",
 7          "s3:PutObject",
 8          "s3:DeleteObject",
 9          "s3:GetBucketLocation",
10          "s3:ListBucket",
11          "s3:ListAllMyBuckets"
12        ],
13        "Effect": "Allow",
14        "Resource": [
15          "arn:aws:s3:::my-site/*"
16        ],
17        "Sid": "Public"
18      }
19    ]
20  }

Install policy to server

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

Assign policy to user

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

That’s all!

#Notes #Linux #Wiki #Minio