ElasticSearch does not record the initialization username and password

When starting ES for the first time, the user name will be initialized: elastic, and the password is randomly generated. The console will display relevant information (including the initialization password) when starting for the first time. Please be careful to save it at this time, otherwise it will not be displayed again during subsequent startups.

For me, I didn’t save the recorded password when I started it for the first time. As a result, I couldn’t log in with the user password after turning on the security policy. I also looked at the log and found that some passwords were not recorded in the log.

So use the command to reset the password: Enter the bin directory of ES and enter the cmd console

Use the following command to reset the elastic user's password. This password is randomly generated and is only displayed once. Be careful to save the record.

elasticsearch-reset-password -u elastic

But in my case, it prompted me that the password reset failed, and there was no reason. I tried various methods online but it didn't work.

Then I thought about it, I didn’t have any data anyway, so I just deleted it all, so I deleted the entire ES folder and unzipped it again.

This time I took a screenshot of the initialization password and recorded it, but I still couldn't log in, which was very strange.

But this time I reset the password successfully. When I logged in with the reset password, the login was successful.

 Attached are other people's solutions I found, which may work for you.

failed to authenticate user [elastic] problem solution_authentication of [elastic] was terminated by real_mingtingshi's blog-CSDN blog

Elasticsearch8 reset elastic user password_elastic password_Xiaobai's blog trying to become Xiaohei-CSDN blog

elasticsearch8.2.0 initialization forgotten password reset-CSDN Blog

Guess you like

Origin blog.csdn.net/m0_54250110/article/details/130196745