title: How to setup password for elasticsearch users?
body: <p>I am trying to enable security for my ES cloud. I am following these instructions:</p>
  
  <p><a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.5/configuring-security.html" rel="noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/7.5/configuring-security.html</a></p>
  
  <p>and I am stuck at point 6. When I try to run <code>bin/elasticsearch-setup-passwords interactive</code> I got error:</p>
  
  <pre><code>Failed to determine the health of the cluster running at http://XXX:9200
  Unexpected response code [503] from calling GET http://XXX:9200/_cluster/health?pretty
  Cause: master_not_discovered_exception
  
  It is recommended that you resolve the issues with your cluster before running elasticsearch-setup-passwords.
  It is very likely that the password changes will fail when run against an unhealthy cluster.
  
  Do you want to continue with the password setup process [y/N]
  </code></pre>
  
  <p>I try to check my ES instance state:</p>
  
  <pre><code>curl http://XXX:9200/_cluster/health?pretty
  </code></pre>
  
  <p>and get</p>
  
  <pre><code>{
    "error" : {
      "root_cause" : [
        {
          "type" : "security_exception",
          "reason" : "missing authentication credentials for REST request [/_cluster/health?pretty]",
          "header" : {
            "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
          }
        }
      ],
      "type" : "security_exception",
      "reason" : "missing authentication credentials for REST request [/_cluster/health?pretty]",
      "header" : {
        "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
      }
    },
    "status" : 401
  }
  </code></pre>
  
  <p>So, looks like I cant setup a password because I can`t authenticate :) ?</p>