Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

ElasticSearch7.x sets user authentication

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

System default user creation password

ElasticSearch is a distributed, highly scalable, high real-time search and data analysis engine based on Lucene, written in Java language. It can easily make a large number of data have the ability to search, analyze and explore.

As an open source project under the Apache license terms, Elasticsearch provides a RESTful web-based interface. Taking full advantage of the horizontal scalability of ElasticSearch can make data more valuable in a production environment. It provides scalable search

Elasticsearch is distributed, which means that the index can be divided into shards, each shard can have 0 or more copies, each node hosts one or more shards, and acts as a coordinator to delegate operations to the correct shards, rebalancing and routing are done automatically. Related data is usually stored in the same index, which consists of one or more primary shards and zero or more replication shards.

# set users to be stored in a special .security index managed by Elasticsearch #

Elasticsearch version: 7.4.2

Tool (included with es): elasticsearch-setup-passwords

1. You need to enable x-pack verification in the configuration file, modify the elasticsearch.yml file under the config directory, and add the following

# # Cross-domain issues related to head

Http.cors.enabled: true

Http.cors.allow-origin: "*"

Http.cors.allow-headers: Authorization

# # enabling Authentication

Xpack.security.enabled: true

Xpack.license.self_generated.type: basic

Xpack.security.transport.ssl.enabled: true

# # restart: systemctl restart elasticsearch.service

2. Execute the command to set the user name and password:

Users involved: elastic, kibana, logstash_system, apm_system, beats_system, remote_monitoring_user

Yum installation path file: / usr/share/elasticsearch/bin/elasticsearch-setup-passwords

# # creating keystore File

. / bin/elasticsearch-keystore create

# Interactive password setting

. / bin/elasticsearch-setup-passwords interactive

Command line test:

Curl-u elastic:th@5nMY#sXVIarnvTSX2WP-XGET "HTTP://127.0.0.1:9200/_cat"

3. The command to change the password is as follows

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report