elasticsearch7 set username and password

environment:

windows ,elasticsearch

Change setting

在elasticsearch.yml中添加
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

set password:

Execute the command line in the bin directory of es: elasticsearch-setup-passwords interactive

 

change Password:

curl -H "Content-Type:application/json" -XPOST -u elastic 'http://127.0.0.1:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "123456" }'

reset Password:

Modify elasticsearch.ymlthe file, restart E

 #Whether to enable the security settings of es, after the security settings are enabled, the transmission of each node and client of es will be encrypted, and the account password is required
xpack.security.enabled: false

Guess you like

Origin blog.csdn.net/qq_38423256/article/details/130090013