# Connection failed to Elasticsearch: failed to authenticate user

**URL:** <https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650>\
**Category:** Elasticsearch\
**Created:** [January 23, 2018, 10:56am UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650 "2018-01-23T10:56:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rym\_Guerbi\_Michaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rym_guerbi_michaut/32/25496_2.png) [@Rym\_Guerbi\_Michaut](https://discuss.elastic.co/u/Rym_Guerbi_Michaut)\
**Post date:** [January 23, 2018, 10:56am UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/1 "2018-01-23T10:56:26Z")

</div>

Hi there,

After installing x-pack for Elasticsearch 6.1 and Logstash and even for Kibana, I'm facing some new problems.

I cannot get connected to Elasticsearch.

The error generated:

```auto
[2018-01-23T11:46:54,606][INFO][o.e.x.s.a.AuthenticationService] [uha1hg-] Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]

```

I tried to enter the password using this command:

```auto
curl -u elastic -XGET 'http://localhost:9200/_cat/health?v'

```

and it generates a `connection refused` error.

PS: I'm sure of the password

May someone helps, please?  
Thank's in advance.

---

<div class="post-metadata">

**Author:** ![Fram\_Souza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fram_souza/32/24833_2.png) [@Fram\_Souza](https://discuss.elastic.co/u/Fram_Souza)\
**Post date:** [January 23, 2018, 11:11am UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/2 "2018-01-23T11:11:55Z")

</div>

Hi @Rym_Guerbi_Michaut

you restarted all nodes of the cluster after install x-pack ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 23, 2018, 11:13am UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/3 "2018-01-23T11:13:28Z")

</div>

I moved your question to #x-pack

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [January 23, 2018, 11:38am UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/4 "2018-01-23T11:38:13Z")

</div>

> [@Rym\_Guerbi\_Michaut](#):
>
> it generates a connection refused error.

The mostly likely cause of that error message would be that ES isn't listening on `localhost:9200`

The reasons for that might be:

1. Your ES node wasn't running when you tried that command
2. You're listening on a non-standard port (have you configured `http.port` ?)
3. You're listening on a external IP rather than "localhost" (have you configured `network.host` ?)
4. You turned off the HTTP interface (have you configured `http.enabled` ?)

---

<div class="post-metadata">

**Author:** ![Rym\_Guerbi\_Michaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rym_guerbi_michaut/32/25496_2.png) [@Rym\_Guerbi\_Michaut](https://discuss.elastic.co/u/Rym_Guerbi_Michaut)\
**Post date:** [January 23, 2018, 12:35pm UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/5 "2018-01-23T12:35:00Z")

</div>

> [@TimV](#):
>
> The mostly likely cause of that error message would be that ES isn't listening on localhost:9200
> 
> The reasons for that might be:
> 
> Your ES node wasn't running when you tried that command  
> You're listening on a non-standard port (have you configured http.port ?)  
> You're listening on a external IP rather than "localhost" (have you configured network.host ?)  
> You turned off the HTTP interface (have you configured http.enabled ?)

Hi Tim,  
ES seems to be actually listening on localhost:9200

 ![screenshot](https://us1.discourse-cdn.com/elastic/original/3X/f/f/ff0e15eb6c74c073c7b93dc509c4a7cd9393ca26.png)

Hi Fram,  
No, I didn't close the nodes, as I thought that whenever we turn down ES, all the nodes are closed automatically, no?

---

<div class="post-metadata">

**Author:** ![Fram\_Souza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fram_souza/32/24833_2.png) [@Fram\_Souza](https://discuss.elastic.co/u/Fram_Souza)\
**Post date:** [January 23, 2018, 12:37pm UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/6 "2018-01-23T12:37:08Z")

</div>

You need restart all nodes after install and configure x-pack.

---

<div class="post-metadata">

**Author:** ![Rym\_Guerbi\_Michaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rym_guerbi_michaut/32/25496_2.png) [@Rym\_Guerbi\_Michaut](https://discuss.elastic.co/u/Rym_Guerbi_Michaut)\
**Post date:** [January 23, 2018, 3:12pm UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/7 "2018-01-23T15:12:29Z")

</div>

Thank's for your help @Fram_Souza, I've uninstalled x-pack, sounds too complicated for me for now...  
I may install it later, once I would have a better understanding of ELK 🙂

---

<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:** [February 20, 2018, 3:12pm UTC](https://discuss.elastic.co/t/connection-failed-to-elasticsearch-failed-to-authenticate-user/116650/8 "2018-02-20T15:12:35Z")

</div>

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