Secret key prompt (#3083)

This commit is contained in:
Jeffrey Clark
2020-03-14 00:03:44 -07:00
committed by GitHub
parent 5b5d65a142
commit bcbbfa7352
5 changed files with 173 additions and 22 deletions
+33 -4
View File
@@ -99,14 +99,35 @@ MinIO server displays URL, access and secret keys.
#### Usage
```
mc config host add <ALIAS> <YOUR-MINIO-ENDPOINT> <YOUR-ACCESS-KEY> <YOUR-SECRET-KEY>
mc config host add <ALIAS> <YOUR-MINIO-ENDPOINT> [YOUR-ACCESS-KEY] [YOUR-SECRET-KEY]
```
Keys must be supplied by argument or standard input.
Alias is simply a short name to your MinIO service. MinIO end-point, access and secret keys are supplied by your MinIO service. Admin API uses "S3v4" signature and cannot be changed.
```
mc config host add minio http://192.168.1.51:9000 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12
```
### Examples
1. Keys by argument
```
mc config host add minio http://192.168.1.51:9000 BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12
```
2. Keys by prompt
```
mc config host add minio http://192.168.1.51:9000
Enter Access Key: BKIKJAA5BMMU2RHO6IBB
Enter Secret Key: V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12
```
2. Keys by pipe
```
echo -e "BKIKJAA5BMMU2RHO6IBB\nV7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12" | \
mc config host add minio http://192.168.1.51:9000
```
## 4. Test Your Setup
@@ -439,6 +460,14 @@ COMMANDS:
mc admin user add myminio/ newuser newuser123
```
*Example: Add a new user 'newuser' on MinIO, using standard input.*
```
mc admin user add myminio/
Enter Access Key: newuser
Enter Secret Key: newuser123
```
*Example: Disable a user 'newuser' on MinIO.*
```
+20 -1
View File
@@ -119,9 +119,11 @@ To add one or more Amazon S3 compatible hosts, please follow the instructions be
#### Usage
```
mc config host add <ALIAS> <YOUR-S3-ENDPOINT> <YOUR-ACCESS-KEY> <YOUR-SECRET-KEY> <API-SIGNATURE>
mc config host add <ALIAS> <YOUR-S3-ENDPOINT> [YOUR-ACCESS-KEY] [YOUR-SECRET-KEY] [--api API-SIGNATURE]
```
Keys must be supplied by argument or standard input.
Alias is simply a short name to your cloud storage service. S3 end-point, access and secret keys are supplied by your cloud storage provider. API signature is an optional argument. By default, it is set to "S3v4".
### Example - MinIO Cloud Storage
@@ -146,6 +148,23 @@ Get your AccessKeyID and SecretAccessKey by following [Google Credentials Guide]
mc config host add gcs https://storage.googleapis.com BKIKJAA5BMMU2RHO6IBB V8f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12
```
### Example - Specify keys using standard input
1. Prompt
```
mc config host add minio http://192.168.1.51 --api S3v4
Enter Access Key: BKIKJAA5BMMU2RHO6IBB
Enter Secret Key: V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12
```
2. Pipe
```
echo -e "BKIKJAA5BMMU2RHO6IBB\nV7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12" | \
mc config host add minio http://192.168.1.51 --api S3v4
```
### Specify host configuration through environment variable
```
export MC_HOST_<alias>=https://<Access Key>:<Secret Key>@<YOUR-S3-ENDPOINT>