1

I want to modify the password of the container created by the elasticsearch image,I have executed the following orders

setup-passwords auto

but it did't work enter image description here

unexpected response code [403] from GET http://172.17.0.2:9200/_xpack/security/_authenticate?pretty

Please help me. Thank you.

2
  • Instead of posting the relevant error message in an externally hosted image, can you copy and paste the text from your terminal and include it as part of the question? Commented Jun 12, 2018 at 15:47
  • Unexpected response code [403] from calling GET 172.17.0.2:9200/_xpack/se curity/_authenticate?pretty Possible causes include: * The relative path of the URL is incorrect. Is there a proxy in-between? * The protocol (http/https) does not match the port. * Is this really an Elasticsearch server?
    – L.Ming
    Commented Jun 12, 2018 at 16:02

1 Answer 1

1

When using docker it is usually best to configure services via environment variables. To set a password for the elasticsearch service you can run the container using the env variable ELASTIC_PASSWORD:

docker run -e ELASTIC_PASSWORD=`openssl rand -base64 12` -p 9200:9200 --rm --name elastic docker.elastic.co/elasticsearch/elasticsearch-platinum:6.2.4

openssl rand -base64 12 sets a random value for the password

2
  • thank you very much,you've solved what I haven't solved in a day
    – L.Ming
    Commented Jun 13, 2018 at 1:21
  • :) You're welcome! Remember to mark the answer as correct if it solved the question Commented Jun 13, 2018 at 7:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.