1

I have Es version 7.6.2 I saw on website that from version 6.2 onwards x-pack is included by default but i was not able to find or enable x-pack for security. how do i enable password protection in Elastic search.

rahul
  • 232
  • 1
  • 5
  • 13

3 Answers3

4

As per elastic search documentation

The first thing you have to do is download the default distribution of Elasticsearch and Kibana version 6.8+ or 7.1+. Security was added to the default distribution in 7.1 and 6.8, so if you’re on an older version, you’ll need to upgrade.

After downloading latest version , you need to enable xpack.security.enabled: true in elasticsearch.yml file

To generate passwords

elasticsearch-setup-passwords auto

in command prompt, your cmd path should be elasticsearch/bin. It will auto generate passwords for elasticsearch kibana etc. note them . If you want to provide your own username password instead of auto generated execute

elasticsearch-setup-passwords interactive

In kibana.yml update below two with user name and password for elastic search you got by executing set up password

elasticsearch.username: "<elastic>"
elasticsearch.password: "<password>"

Opening kubana it will prompt for username and password, enter password for "kibana" you got from set-up-password

jaspreet chahal
  • 8,817
  • 2
  • 11
  • 29
  • I am able to password protect ES however my kibana is now asking for UID and password when opened. The ES credentials dont work on the kibana screen. What password does Kibana looking for ? – rahul May 08 '20 at 10:45
  • @rahul changes in es affect kibana too. you can execute elasticsearch-setup-passwords.exe in bin folder. It will automatically generate passwords for different users – jaspreet chahal May 08 '20 at 10:58
  • I tried it and set passwords for following users in ES using elasticsearch-setup-passwords.exe- apm_system, kibana, logstash_system, beats_system, remote_minitoring_user, elastic – rahul May 08 '20 at 11:11
  • however the Passwords i set for ES are not working when i try to login in Kibana – rahul May 08 '20 at 11:11
  • thanks for your prompt reply. I tried the password of kibana in the Kibana uid/password Webpage but it is not accepting it/.....screenshot at https://discuss.elastic.co/t/after-enabling-xpack-in-es-how-do-i-login-in-kibana/231530/6 – rahul May 08 '20 at 13:27
  • @rahul can you mention the steps you have performed. 1 generate password using set-up password it will give password for elasticsearch, kibana, apm etc. 2. Update kibana.yml file with password for elasticsearch , the 2 lines I mentioned in answer. 3. Start kibana . Enter the username and password for kibana – jaspreet chahal May 08 '20 at 13:47
  • its not working for me ...showing forbidden error after login ...see screenshot https://imgur.com/Wq9Ke0E – rahul May 09 '20 at 12:54
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/213487/discussion-between-jaspreet-chahal-and-rahul). – jaspreet chahal May 09 '20 at 13:18
  • Kibana user didnt had all privilages i think slastic user was able to login – rahul May 09 '20 at 14:16
0

I am able to password protect ES however my kibana is now asking for UID and password when opened. The ES credentials dont work on the kibana screen. What password does Kibana looking for ?

rahul
  • 232
  • 1
  • 5
  • 13
0

isseue resolved by using elastic user rather than kibana user

rahul
  • 232
  • 1
  • 5
  • 13