elasticsearch-users -h/--help查看用法

/app/elasticsearch-7.8.0/bin/elasticsearch-users -h

******/app/elasticsearch-7.8.0/bin/elasticsearch-users -h******
Manages elasticsearch file users

Commands
--------
useradd - Adds a file user
userdel - Deletes a file based user
passwd - Changes the password of an existing file based user
roles - Edit roles of an existing user
list - List existing file based users and their corresponding roles

Non-option arguments:
command              

Option             Description        
------             -----------        
-E <KeyValuePair>  Configure a setting
-h, --help         Show help          
-s, --silent       Show minimal output
-v, --verbose      Show verbose output
******/app/elasticsearch-7.8.0/bin/elasticsearch-users -h******

创建超级用户,一般用于修改密码

/app/elasticsearch-7.8.0/bin/elasticsearch-users useradd myusers -p myuser -r superuser

curl -XPUT -u"myusers:myuser" “http://localhost:9200/_xpack/security/user/elastic/_password?pretty” -H “Content-Type: application/json” -d ‘{“password” : “xxxxxx”}’

查看已经创建的用户

/app/elasticsearch-7.8.0/bin/elasticsearch-users list
myusers : superuser

删除已经创建的用户

/app/elasticsearch-7.8.0/bin/elasticsearch-users userdel myusers

所有创建的用户都存于这个文件里

vim /app/elasticsearch-7.8.0/config/users_roles

全篇完

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐