美文网首页
minio权限管理

minio权限管理

作者: 郝以平 | 来源:发表于2020-10-30 16:00 被阅读0次

下载mc工具

MinIO Client
https://docs.min.io/docs/minio-client-quickstart-guide.html
brew install minio/stable/mc
mc --help

权限Json

只读

{
 "Version": "2012-10-17",
 "Statement": [
   {
     "Effect": "Allow",
     "Action": [
       "s3:ListAllMyBuckets",
       "s3:ListBucket",
       "s3:GetBucketLocation",
       "s3:GetObject"
     ],
     "Resource": [
       "arn:aws:s3:::*"
     ]
   }
 ]
}

只传

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

Makefile脚本

test:
  echo $(hello)

para:
  make test hello=HHHHHH

alias_minio:
  mc  alias set myminio  http://n1:25955/  admin haoyiping

add_policy:
   mc admin policy add myminio get_only get_only.json
   mc admin policy add myminio get_put get_put.json
   mc admin policy add myminio put_only put_only.json
   mc admin policy add myminio get_put_delete get_put_delete.json

init:
  make alias_minio
  make add_policy

create_user_get_only:
  mc admin user add myminio $(uname) $(pwd)
  mc admin policy set myminio get_only user=$(uname)

create_user_get_put:
  mc admin user add myminio $(uname) $(pwd)
  mc admin policy set myminio get_put user=$(uname)

create_user_put_only:
  mc admin user add myminio $(uname) $(pwd)
  mc admin policy set myminio put_only user=$(uname)

create_user_get_put_delete:
  mc admin user add myminio $(uname) $(pwd)
  mc admin policy set myminio get_put_delete user=$(uname)

delete_user:
  mc admin user delete myminio $(uname)

list_user:
  mc admin user  list myminio

相关文章

网友评论

      本文标题:minio权限管理

      本文链接:https://www.haomeiwen.com/subject/ysjlvktx.html