# Unable to login to elasticsearch,asking password of old installation

**URL:** <https://discuss.elastic.co/t/unable-to-login-to-elasticsearch-asking-password-of-old-installation/278550>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [July 13, 2021, 1:51pm UTC](https://discuss.elastic.co/t/unable-to-login-to-elasticsearch-asking-password-of-old-installation/278550 "2021-07-13T13:51:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandeep\_Raju](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Sandeep\_Raju](https://discuss.elastic.co/u/Sandeep_Raju)\
**Post date:** [July 13, 2021, 1:51pm UTC](https://discuss.elastic.co/t/unable-to-login-to-elasticsearch-asking-password-of-old-installation/278550/1 "2021-07-13T13:51:10Z")

</div>

Hi all,

I'm trying to install a new version of elasticsearch and kibana.  
However, when i install, some old cache of previous installation is asking me elastic login and password.  
I have forgotten old installation elastic password.  
It am unable to setup new xpack.  
I have tried change password , reset password API's for this.  
But I get the below error for all:

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "missing authentication credentials for REST request [/_security/user/elastic?pretty]",
        "header" : {
          "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "missing authentication credentials for REST request [/_security/user/elastic?pretty]",
    "header" : {
      "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },
  "status" : 401
}

```

**Need help on recovering old password or to delete old cache so that i can set new password.**

---

<div class="post-metadata">

**Author:** ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)\
**Post date:** [July 14, 2021, 12:13am UTC](https://discuss.elastic.co/t/unable-to-login-to-elasticsearch-asking-password-of-old-installation/278550/2 "2021-07-14T00:13:35Z")

</div>

If you have configured `xpack.security.enabled: true`, you'll be required to authenticate for each request. This is true regardless whether it is a new cluster or an upgraded cluster.

If this is truely a new cluster, passwords for builtin users (including `elastic`) can be easily configured with the [setup-passwords tool](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-passwords.html).

If this is an upgraded cluster, you can configure a new [file-based superuser](https://www.elastic.co/guide/en/elasticsearch/reference/current/file-realm.html) to get access to your cluster and reset passwords for other users. If you don't care about previous security setup and prefer to "delete old cache", you can just delete the security index and then re-configure them using the setup-passwords tool linked above.

---

<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:** [August 11, 2021, 12:13am UTC](https://discuss.elastic.co/t/unable-to-login-to-elasticsearch-asking-password-of-old-installation/278550/3 "2021-08-11T00:13:41Z")

</div>

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