Set passwords with a script

Hi,

I want to set passwords using password API.
I saw that method to set passwords : https://discuss.elastic.co/t/how-to-set-passwords-for-built-in-users-in-batch-mode/119655/5

As i use docker elasticsearch, i setted bootstrap password with ELASTIC_PASSWORD: changeme.

When i try to set password manually it just do nothing, holding my term for an infinite time

$ curl -D- 'http://127.0.0.1:9200/_cluster/health?pretty' -u elastic:changeme
HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 467

{
  "cluster_name" : "docker-cluster",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 1,
  "active_shards" : 2,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}
$ curl -XPUT -H 'Content-Type: application/json' 'http://localhost:9200/_xpack/security/user/kibana/_password' -d '{ "password":"0LbH70f7j2z8FrBd166X" }' -u elastic:changeme

Any help would be appreciated.

Ok that was weird... problem is "localhost" which is not resolved in curl query but is in nslookup query...
Changed to 127.0.0.1 solved it.