# Authentication Error for User \[elastic\] When Accessing Elasticsearch from Kibana

**URL:** https://discuss.elastic.co/t/authentication-error-for-user-elastic-when-accessing-elasticsearch-from-kibana/374251
**Category:** Community Ecosystem
**Tags:** license
**Created:** [February 8, 2025, 8:34am UTC](https://discuss.elastic.co/t/authentication-error-for-user-elastic-when-accessing-elasticsearch-from-kibana/374251 "2025-02-08T08:34:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![TYQ33](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tyq33/32/136825_2.png) [@TYQ33](https://discuss.elastic.co/u/TYQ33)
#### Post date: [February 8, 2025, 8:34am UTC](https://discuss.elastic.co/t/authentication-error-for-user-elastic-when-accessing-elasticsearch-from-kibana/374251/1 "2025-02-08T08:34:14Z")

</div>

Hi everyone,

I'm encountering an authentication issue between Kibana and Elasticsearch. Upon starting Kibana, I receive the following error indicating that Kibana cannot obtain license information from Elasticsearch due to an authentication failure of the user [elastic]. The specific REST request it tries to make is [/\_xpack], which results in a 401 unauthorized status.

Here's the error log from Kibana:

```auto
{
  "type": "log",
  "@timestamp": "2025-02-08T01:42:20Z",
  "tags": ["warning", "plugins", "licensing"],
  "pid": xxxxx,
  "message": "License information could not be obtained from Elasticsearch due to [security_exception] unable to authenticate user [elastic] for REST request [/_xpack], with { header={ WWW-Authenticate=\"Basic realm=\"security\" charset=\"UTF-8\" } } : ...",
  "wwwAuthenticateDirective": "Basic realm=\"security\" charset=\"UTF-8\" error"
}

```

Additionally, Elasticsearch logs indicate a similar problem:

```auto
Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]

```

It seems there's a problem with authenticating the 'elastic' user, preventing Kibana from connecting properly. Could this be related to incorrect credentials or misconfiguration? Any advice on troubleshooting steps or configurations to check would be greatly appreciated.

Thanks in advance for any help!

---

<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: [February 8, 2025, 4:14pm UTC](https://discuss.elastic.co/t/authentication-error-for-user-elastic-when-accessing-elasticsearch-from-kibana/374251/2 "2025-02-08T16:14:27Z")

</div>

Hi @TYQ33

The error is really just a connection / authentication error...

What version are you using?  
How /what instructions did you follow?  
What type of installation?

Please share your entire elasticsearch.yml and kibana.yml.

---

<div class="post-metadata">

### Author: ![TYQ33](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tyq33/32/136825_2.png) [@TYQ33](https://discuss.elastic.co/u/TYQ33)
#### Post date: [February 10, 2025, 1:38am UTC](https://discuss.elastic.co/t/authentication-error-for-user-elastic-when-accessing-elasticsearch-from-kibana/374251/3 "2025-02-10T01:38:05Z")

</div>

Details of My Setup:  
Version: Elasticsearch 7.9.3  
Installation Type: Cluster with 3 master nodes and 3 data nodes  
elasticsearch.yml Configuration:

```auto
cluster.name: xxxxx
node.name: node-xxxxx
node.master: true
node.data: true
path.data: data
bootstrap.memory_lock: true
network.host: xxxxx
network.publish_host: xxxxx
http.port: xxxxx
transport.tcp.port: xxxxx
discovery.seed_hosts: ["IP1:PORTA","IP2:PORTA","IP3:PORTA"]
cluster.initial_master_nodes: ["node-xxxxx","node-xxxxx","node-xxxxx"]
action.auto_create_index: true
action.destructive_requires_name: true
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /xxxxxx/elasticsearch/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /xxxxxx/elasticsearch/config/elastic-stack-ca.p12

```

kibana.yml Configuration:

```auto
server.port: xxxx
server.host: 0.0.0.0
elasticsearch.hosts: ["IP1:PORTB","IP2:PORTB","IP3:PORTB"]
i18n.locale: en

```

I have already tried modifying the Elasticsearch password, and curl commands are working correctly. The Elasticsearch cluster is also functioning normally. However, when I start Kibana, I still encounter the same authentication error.  
Could you please provide any additional steps or configurations that might help resolve this issue?

Best regards.

---

<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: [February 10, 2025, 1:45am UTC](https://discuss.elastic.co/t/authentication-error-for-user-elastic-when-accessing-elasticsearch-from-kibana/374251/4 "2025-02-10T01:45:09Z")

</div>

Where is the username and password in kibana.yml

> elasticsearch.username and elasticsearch.password  
> If your Elasticsearch is protected with basic authentication, these settings provide the username and password that the Kibana server uses to perform maintenance on the Kibana index at startup. Kibana users still need to authenticate with Elasticsearch, which is proxied through the Kibana server.

Also 7.9 is Sooooo old out of date out of date security patched you should upgrade with a matter of urgency

---

<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: [March 10, 2025, 1:45am UTC](https://discuss.elastic.co/t/authentication-error-for-user-elastic-when-accessing-elasticsearch-from-kibana/374251/5 "2025-03-10T01:45:34Z")

</div>

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