Skip to content

Instantly share code, notes, and snippets.

@patsevanton
Created April 27, 2020 14:34
Show Gist options
  • Select an option

  • Save patsevanton/9d6a62c99f208c63b8f15b3abcc13054 to your computer and use it in GitHub Desktop.

Select an option

Save patsevanton/9d6a62c99f208c63b8f15b3abcc13054 to your computer and use it in GitHub Desktop.
[root@minio-apatsev bin]# mc config host add minio http://localhost minio minio123 --api S3v4
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
Added `minio` successfully.
[root@minio-apatsev bin]# mc config host add minio http://localhost:9000 minio minio123 --api S3v4
Added `minio` successfully.
[root@minio-apatsev bin]# mc --debug ls minio
mc: <DEBUG> GET / HTTP/1.1
Host: localhost:9000
User-Agent: MinIO (linux; amd64) minio-go/v6.0.54 mc/2020-04-25T00:43:23Z
Authorization: AWS4-HMAC-SHA256 Credential=minio/20200427/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20200427T143142Z
Accept-Encoding: gzip
mc: <DEBUG> HTTP/1.1 200 OK
Content-Length: 270
Accept-Ranges: bytes
Content-Security-Policy: block-all-mixed-content
Content-Type: application/xml
Date: Mon, 27 Apr 2020 14:31:42 GMT
Server: MinIO/RELEASE.2020-04-23T00-58-49Z
Vary: Origin
X-Amz-Request-Id: 1609B3ADCEA9CC7D
X-Xss-Protection: 1; mode=block
mc: <DEBUG> Response Time: 1.950077ms
mc: <DEBUG> GET / HTTP/1.1
Host: localhost:9000
User-Agent: MinIO (linux; amd64) minio-go/v6.0.54 mc/2020-04-25T00:43:23Z
Authorization: AWS4-HMAC-SHA256 Credential=minio/20200427/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=**REDACTED**
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20200427T143142Z
Accept-Encoding: gzip
mc: <DEBUG> HTTP/1.1 200 OK
Content-Length: 270
Accept-Ranges: bytes
Content-Security-Policy: block-all-mixed-content
Content-Type: application/xml
Date: Mon, 27 Apr 2020 14:31:42 GMT
Server: MinIO/RELEASE.2020-04-23T00-58-49Z
Vary: Origin
X-Amz-Request-Id: 1609B3ADCEBE221B
X-Xss-Protection: 1; mode=block
mc: <DEBUG> Response Time: 606.24µs
[root@minio-apatsev bin]# mc mb minio/testbucket1
Bucket created successfully `minio/testbucket1`.
[root@minio-apatsev bin]# mc mb minio/testbucket2
Bucket created successfully `minio/testbucket2`.
[root@minio-apatsev bin]# vi test1.json
[root@minio-apatsev bin]# vi test1.json
[root@minio-apatsev bin]# vi test1.json
[root@minio-apatsev bin]# vi test2^Cson
[root@minio-apatsev bin]# cp test1.json test1^Cson
[root@minio-apatsev bin]# mc admin user add minio test1 test1234
Added user `test1` successfully.
[root@minio-apatsev bin]# mc mc admin policy add minio test1 test1.json
[root@minio-apatsev bin]# mc admin policy set minio test1 user=test1
mc: <ERROR> Cannot set the policy. The canned policy does not exist. (Specified canned policy does not exist).
[root@minio-apatsev bin]# mc admin policy set minio test1 user=test1.json
mc: <ERROR> Cannot set the policy. The canned policy does not exist. (Specified canned policy does not exist).
[root@minio-apatsev bin]# cat test1.json
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"AWS":[
"*"
]
},
"Action":[
"s3:GetBucketLocation",
"s3:ListBucket",
"s3:ListBucketMultipartUploads"
],
"Resource":[
"arn:aws:s3:::testbucket1"
]
},
{
"Effect":"Allow",
"Principal":{
"AWS":[
"*"
]
},
"Action":[
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:GetObject",
"s3:ListMultipartUploadParts",
"s3:PutObject"
],
"Resource":[
"arn:aws:s3:::test1/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment