elasticsearch-8.0.0用xpack设置密码登陆
elasticsearch-8.0.0用xpack设置密码登陆
elasticsearch正常启动连接后,想设置密码确保安全。
vi elasticsearch.yml,把下面标黄项修改为true
# Enable security features
xpack.security.enabled: truexpack.security.enrollment.enabled: true
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["node-1"]
回到bin目录下,找到elasticsearch-setup-passwords
执行命令:./elasticsearch-setup-passwords interactive
接下来出现界面如下:
[lin@localhost bin]$./elasticsearch-setup-passwords interactive
******************************************************************************
Note: The 'elasticsearch-setup-passwords' tool has been deprecated. This command will be removed in a future release.
******************************************************************************Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]
输入y继续执行,接下来就是让你输入密码,注意后面【】中的内容是用户名,后续用此登陆。
Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana_system]:
Reenter password for [kibana_system]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]
输入密码就按回车,直到出现[lin@localhost bin]$
然后再次登陆ES就会要求你输入用户名和密码了。
更多推荐
所有评论(0)