# How to create build in user without interactive mode or auto

**URL:** <https://discuss.elastic.co/t/how-to-create-build-in-user-without-interactive-mode-or-auto/183420>\
**Category:** Elasticsearch\
**Created:** [May 29, 2019, 8:22pm UTC](https://discuss.elastic.co/t/how-to-create-build-in-user-without-interactive-mode-or-auto/183420 "2019-05-29T20:22:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [May 30, 2019, 1:28am UTC](https://discuss.elastic.co/t/how-to-create-build-in-user-without-interactive-mode-or-auto/183420/2 "2019-05-30T01:28:09Z")

</div>

There is no supported way to run `elasticsearch-setup-passwords` in batch mode. It is a convenience utility for manually configuring a node.

If you want to automate this, then you should use the change password API.

> [@Jiri\_Safar](#):
>
> when I dont have elastic user password I cannot do that.

In which case you need to configure the [bootstrap password](https://www.elastic.co/guide/en/elastic-stack-overview/6.7/built-in-users.html#bootstrap-elastic-passwords) to be a value that you do know.

Something roughly like this will work (but for production usage you'd want to build something more reliable)

```auto
# Configure Bootstrap Password
BootstrapPassword="$( generate-random-password )"
printf "%s" "$BootstrapPassword" \
  | bin/elasticsearch-keystore add -x "bootstrap.password"

# Start ES & Wait for it to be available
bin/elasticsearch -d
while true
do
  curl --fail -u "elastic:$BootstrapPassword" \
    "http://localhost:9200/_cluster/health?wait_for_status=yellow" \
    && break
  sleep 5
done

# Set passwords for various users
for User in "kibana" "logstash_system" "apm_system" "beats_system" "elastic"
do
  UserPassword="$( generate-random-password )"
  curl -u "elastic:${BootstrapPassword}" \
    -XPOST "http://localhost:9200/_xpack/security/user/${User}/_password" \
    -d'{"password":"'"${UserPassword}"'"}' -H "Content-Type: application/json"
  printf "%s=%s\n" "$User" "$UserPassword" >> passwords.txt
done

```

---

_[View the full topic](https://discuss.elastic.co/t/how-to-create-build-in-user-without-interactive-mode-or-auto/183420)._
