# Setup-passwords runs multiple times. It's not supposed to?

**URL:** https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497
**Category:** Elasticsearch
**Created:** [November 29, 2017, 1:23am UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497 "2017-11-29T01:23:55Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bradley](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bradley](https://discuss.elastic.co/u/bradley)
#### Post date: [November 29, 2017, 1:23am UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/1 "2017-11-29T01:23:55Z")

</div>

In the documentation on [https://www.elastic.co/guide/en/x-pack/current/setting-up-authentication.html](https://www.elastic.co/guide/en/x-pack/current/setting-up-authentication.html), it says, "After you set a password for the elastic user, the bootstrap password is no longer valid; you cannot run the setup-passwords command a second time." The second clause is untrue. I have run 'bin/x-pack/setup-passwords auto' multiple times, and it has reset the passwords each time. I don't know if this is a security problem, but thought I would bring it to your attention.

---

<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: [November 29, 2017, 1:45am UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/2 "2017-11-29T01:45:31Z")

</div>

Can you provide more details about how you ran it?

There are some edge cases in the tool where it fails to change the passwords, but doesn't report the errors correctly. If that happens, then the tool will appear to run multiple times because it isn't actually doing anything. Those issues are due to be fixed in an upcoming patch release.

---

<div class="post-metadata">

### Author: ![bradley](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bradley](https://discuss.elastic.co/u/bradley)
#### Post date: [November 29, 2017, 1:51am UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/3 "2017-11-29T01:51:34Z")

</div>

I ran it yesterday from the terminal, and then a few more times today. It output different passwords each time. As yet, I'm not sure how to test the passwords, as I'm just now learning this stuff. What other details can I provide?

---

<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: [November 29, 2017, 2:35am UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/4 "2017-11-29T02:35:43Z")

</div>

> I'm not sure how to test the passwords

The easiest way to test a password from the terminal is:

```auto
curl -uelastic http://localhost:9200/

```

That will prompt you for the password.  
You may need to change the URL if you're running ES on a different port, or binding to a different address.

> What other details can I provide?

Did you provide any command-line options to `setup-passwords`?  
In particular, the `--url` option is known to cause problems if you don't pass the value in exactly the expected format.

---

<div class="post-metadata">

### Author: ![bradley](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bradley](https://discuss.elastic.co/u/bradley)
#### Post date: [November 29, 2017, 5:35pm UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/5 "2017-11-29T17:35:34Z")

</div>

I tried the command to test the password, but I'm not seeing success or fail in the response. It says:

```
{
  "name" : "oxyvoYJ",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "lYf60mkSSWmQiEXpNbVj9Q",
  "version" : {
    "number" : "6.0.0",
    "build_hash" : "8f0685b",
    "build_date" : "2017-11-10T18:41:22.859Z",
    "build_snapshot" : false,
    "lucene_version" : "7.0.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

The command I used to reset paswords was exactly `bin/x-pack/setup-passwords auto`.

---

<div class="post-metadata">

### Author: ![bradley](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bradley](https://discuss.elastic.co/u/bradley)
#### Post date: [November 29, 2017, 7:33pm UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/6 "2017-11-29T19:33:56Z")

</div>

Today I started with a freshly installed instance of Elasticsearch, and installed x-pack before I ran it. I tried consecutive auto-setting the passwords again, and it didn't allow me to do it this time.

```
Failed to authenticate user 'elastic' against http://127.0.0.1:9200/_xpack/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 /usr/local/elastic-stack/elasticsearch-6.0.0/config/elasticsearch.keystore
```

---

<div class="post-metadata">

### Author: ![bradley](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bradley](https://discuss.elastic.co/u/bradley)
#### Post date: [November 29, 2017, 9:43pm UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/7 "2017-11-29T21:43:38Z")

</div>

I do still have the instance that was malfunctioning, if there's any more info you want from it.

---

<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: [November 29, 2017, 11:37pm UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/8 "2017-11-29T23:37:55Z")

</div>

> [@bradley](#):
>
> I'm not seeing success or fail in the response

That's a success. You get a fairly obvious error message if it fails, and anything else is a success.

> [@bradley](#):
>
> I do still have the instance that was malfunctioning, if there's any more info you want from it.

I'll send you a private message.  
Thanks.

---

<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: [December 27, 2017, 11:37pm UTC](https://discuss.elastic.co/t/setup-passwords-runs-multiple-times-its-not-supposed-to/109497/9 "2017-12-27T23:37:59Z")

</div>

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