mc admin user add 命令用来添加一个新用户,语法如下:
C:\>mc admin user add -h NAME: mc admin user add - add a new user USAGE: mc admin user add TARGET ACCESSKEY SECRETKEY ACCESSKEY: Also called as username. SECRETKEY: Also called as password. FLAGS: --config-dir value, -C value path to configuration folder (default: "C:\\Users\\Administrator\\mc") --quiet, -q disable progress bar display --no-color disable color theme --json enable JSON lines formatted output --debug enable debug output --insecure disable SSL certificate verification --help, -h show help
(1)添加一个新用户 'foobar' 到 MinIO 服务器。
D:\server\minio>mc admin user add local foobar foo12345 Added user `foobar` successfully.
(2)向 MinIO 服务器添加一个新用户 'foobar',提示输入密钥。
C:\> mc admin user add myminio Enter Access Key: foobar Enter Secret Key: foobar12345 Added user `foobar` successfully.
(3)使用管道键将新用户“foobar”添加到 MinIO 服务器。
a、将用户密钥存放到当前目录的 password.txt 文件中,内容如下:
foobar foobar12345
b、使用 type 命令和管道命令作为 mc admin user add 命令的输入信息,如下:
D:\server\minio>type password.txt | mc admin user add local Added user `foobar` successfully.