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

**URL:** <https://discuss.elastic.co/t/failed-to-authenticate-user-elastic-against-https-192-168-xx-xx-9200-security-authenticate-pretty/342654>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [September 9, 2023, 10:05am UTC](https://discuss.elastic.co/t/failed-to-authenticate-user-elastic-against-https-192-168-xx-xx-9200-security-authenticate-pretty/342654 "2023-09-09T10:05:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![uli67](https://avatars.discourse-cdn.com/v4/letter/u/0ea827/32.png) [@uli67](https://discuss.elastic.co/u/uli67)\
**Post date:** [September 9, 2023, 10:05am UTC](https://discuss.elastic.co/t/failed-to-authenticate-user-elastic-against-https-192-168-xx-xx-9200-security-authenticate-pretty/342654/1 "2023-09-09T10:05:01Z")

</div>

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:

```auto

./elasticsearch-setup-passwords auto

```

or

```auto

./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:

```auto
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:

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

```

What must I do to fix that ?

Many thanks in advance

Uli

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 9, 2023, 10:02pm UTC](https://discuss.elastic.co/t/failed-to-authenticate-user-elastic-against-https-192-168-xx-xx-9200-security-authenticate-pretty/342654/2 "2023-09-09T22:02:10Z")

</div>

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.

> **[elasticsearch-reset-password | Elasticsearch Guide \[8.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-password.html)**

Example

`bin/elasticsearch-reset-password -u elastic`

Then try

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

---

<div class="post-metadata">

**Author:** ![uli67](https://avatars.discourse-cdn.com/v4/letter/u/0ea827/32.png) [@uli67](https://discuss.elastic.co/u/uli67)\
**Post date:** [September 11, 2023, 8:25am UTC](https://discuss.elastic.co/t/failed-to-authenticate-user-elastic-against-https-192-168-xx-xx-9200-security-authenticate-pretty/342654/3 "2023-09-11T08:25:14Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 11, 2023, 2:00pm UTC](https://discuss.elastic.co/t/failed-to-authenticate-user-elastic-against-https-192-168-xx-xx-9200-security-authenticate-pretty/342654/4 "2023-09-11T14:00:33Z")

</div>

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?.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 9, 2023, 2:00pm UTC](https://discuss.elastic.co/t/failed-to-authenticate-user-elastic-against-https-192-168-xx-xx-9200-security-authenticate-pretty/342654/5 "2023-10-09T14:00:59Z")

</div>

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