Failed to authenticate user 'elastic' against https://192.168.xx.xx:9200/_security/_authenticate?pretty

Hi fellows,
your help is needed. I have installed elasticsearch for the first time on my Alma-Linux9.
That worked so far elastisearch runs on port 9200
tcp6 0 0 :::9200 :::* LISTEN 383870/java
When I try to execute this command:


./elasticsearch-setup-passwords auto

or


./elasticsearch-setup-passwords interactive

I get the following error message: Failed to authenticate user 'elastic' against https://192.168.10.4:9200/_security/_authenticate?pretty

and the browser shows:
{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","Bearer realm="security"","ApiKey"]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Basic realm="security" charset="UTF-8"","Bearer realm="security"","ApiKey"]}},"status":401}

Resetting a password also fails with:

Failed to determine the health of the cluster. Cluster health is currently RED.
This means that some cluster data is unavailable and your cluster is not fully functional.

users-list shows:

./elasticsearch-users list
admin          : superuser
username       : superuser

What must I do to fix that ?

Many thanks in advance

Uli

Hi @uli67 Welcome to the community.

What version of Elasticsearch and how did you install?

But in short If you did a normal basic, install the elastic username and password would have been printed to the console.

If you did not capture that, you need to just reset the elastic password.

The command you're trying to use is part of the bootstrap process which you don't need at this point.

Example

bin/elasticsearch-reset-password -u elastic

Then try

curl -k -u elastic https://192.168.10.4:9200

Hi Stephenb,

it is eleasticsearch 8.0 that I installed with the rhel packet-mananger from the kibana repo (dnf install --enablerepo=elasticsearch elasticsearch kibana)

I havent´ t set any passwords and I don´ t know the password for user elastic.

Here is my config:

The command I gave you will set the password since you don't know it.

The elastic user and password was set when you installed it. Scrolled by in the install output on the command line option perhaps you missed it.

So reset it using the command I gave you above.

Also curious why you're installing 8.0 brand new should install 8.9.1 the latest?.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.