Set admin password at docker run

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?

1 Like

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: