# Set admin password at docker run

**URL:** https://forums.suse.com/t/set-admin-password-at-docker-run/10084
**Category:** Rancher 2.0 Tech Preview
**Created:** [April 16, 2018, 12:01am UTC](https://forums.suse.com/t/set-admin-password-at-docker-run/10084 "2018-04-16T00:01:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![afgane](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/afgane/32/3796_2.png) [@afgane](https://forums.suse.com/u/afgane)
#### Post date: [April 16, 2018, 12:01am UTC](https://forums.suse.com/t/set-admin-password-at-docker-run/10084/1 "2018-04-16T00:01:03Z")

</div>

Is it possible to set the initial admin password via an env variable perhaps when Rancher 2.0 is started via the `docker run` command?

If not, is hitting `https://<IP>/v3/users?action=changepassword` the proper endpoint to target to set it up?

---

<div class="post-metadata">

### Author: ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)
#### Post date: [April 16, 2018, 12:11am UTC](https://forums.suse.com/t/set-admin-password-at-docker-run/10084/2 "2018-04-16T00:11:23Z")

</div>

No, that leaves the password lying around in the container definition forever.

`changepassword` changes the authenticated user’s pw and requires knowing the current one. There’s also a `setpassword` on individual users which an admin can call to set the pw for any user to something new (without knowing the old one).

Since on setup admin is going to be the only user, either will work.

You probably want something like this: [https://gist.githubusercontent.com/superseb/c363247c879e96c982495daea1125276/raw/98d9c0590992f2b7e209ae4e0a7da7da1db5aee0/rancher2customnodecmd.sh](https://gist.githubusercontent.com/superseb/c363247c879e96c982495daea1125276/raw/98d9c0590992f2b7e209ae4e0a7da7da1db5aee0/rancher2customnodecmd.sh)
