# Fundamentals of Securing Elasticsearch- reset environment

**URL:** <https://discuss.elastic.co/t/fundamentals-of-securing-elasticsearch-reset-environment/230658>\
**Category:** Elastic Training\
**Created:** [May 1, 2020, 2:28am UTC](https://discuss.elastic.co/t/fundamentals-of-securing-elasticsearch-reset-environment/230658 "2020-05-01T02:28:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![x0rcist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/x0rcist/32/66605_2.png) [@x0rcist](https://discuss.elastic.co/u/x0rcist)\
**Post date:** [May 1, 2020, 2:28am UTC](https://discuss.elastic.co/t/fundamentals-of-securing-elasticsearch-reset-environment/230658/1 "2020-05-01T02:28:33Z")

</div>

Hi

I am trying **Fundamentals of Securing Elasticsearch** I have one issue:

1: Looks like I need reset machines to default, forgot the password I set for user (I tried restart machine but it didn't work). Advise how to reset the environment

now when I enable the x-pack and try to run `./elasticsearch/bin/elasticsearch-setup-passwords interactive`

It gives me following error

Failed to authenticate user 'elastic' against [http://172.18.0.2:9200/\_security/\_authenticate?pretty](http://172.18.0.2:9200/_security/_authenticate?pretty)

Possible causes include:

```
 * The password for the 'elastic' user has already been changed on this cluster                                                                                                                  

 * Your elasticsearch node is running against a different keystore                                                                                                                               

   This tool used the keystore at /home/elastic/elasticsearch/config/elasticsearch.keystore

```

How do I reset the environment to default rather than trouble shooting the keysotre.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Romain\_Geffraye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romain_geffraye/32/77053_2.png) [@Romain\_Geffraye](https://discuss.elastic.co/u/Romain_Geffraye)\
**Post date:** [May 1, 2020, 9:05am UTC](https://discuss.elastic.co/t/fundamentals-of-securing-elasticsearch-reset-environment/230658/2 "2020-05-01T09:05:28Z")

</div>

Hello Mr X0rcist,

If you lost your password, I recommend you to use the [elasticsearch-users](https://www.elastic.co/guide/en/elasticsearch/reference/current/users-command.html) command line to add a new user.

Run the following command on **server1** :

```
elasticsearch/bin/elasticsearch-users useradd superuser -p password -r superuser

```

You can then use this new user to update the password of the **elastic** user:

```
curl -X POST "superuser:password@server1:9200/_security/user/elastic/_password?pretty" -H 'Content-Type: application/json' -d' 
{                                                                                                                                                                                  
  "password" : "newpassword"                                                                                                                              
}'

```

Have a good day,

Romain

---

<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:** [May 31, 2020, 9:14am UTC](https://discuss.elastic.co/t/fundamentals-of-securing-elasticsearch-reset-environment/230658/3 "2020-05-31T09:14:11Z")

</div>

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