How to change the admin password after installation?

I followed the installation and was able to setup senaite.

Now, I am logged in as admin with the password in the guide which was also admin.

Of course, now I need to change the password right away. Though, I don’t find a change password function. Where/how can I change the password to something secure?

Hi @soerendip, login with admin user. Then, type http://localhost:8080/manage_main and go to acl_users > source_users. Look for the username and press the Password link next to it. Type the new password and Save.

Keep in mind that your ‘admin’ user and the users that you create via " instance adduser" are created in acl_users at the root of Zope, not in acl_users within your SENAITE site. Thus, you won’t see the admin user inside acl_users if you go to “Site Setup > Zope Management Interface” .

This said, remember to use admin user for administrative tasks only. https://www.senaite.com/docs/quickstart#add-a-laboratory-manager

1 Like

Thanks. Unfortunately, admin is not listed under

/acl_users/source_users/

Soren

Sorry for the late reply. Your admin username and password are initially set in the buildout.cfg file. You can always view it or change it there then run buildout again. See example [instance] section of buildout.cfg below.

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 0.0.0.0:8080
eggs =
senaite.api
${buildout:eggs}
zcml =
senaite.api
${buildout:zcml}
environment-vars =
zope_i18n_compile_mo_files true

So, it is more or less hard coded into the build and it is not possible to change it after the build. What is about the data and user etc, when I rebuild? Do I have to worry that something gets lost?

Admin password should not be accessible in plan text for production sites…

I suggest to you to read Plone and Zope documentation on this regard:

I hope some of these links help you!

If admin user is not listed at the root of the instance (http://localhost:8080/acl_users/users/manage_users), then simply add a user with the “Add a user” link

Hello from the future!

I spent a while trying to change the password and finally found success. This is one of the first Google results for “Senaite change admin password” so I hope this will be helpful to others.

I tried editing the buildout.cfg and rebuild it but it did not work.

I tried setting the environment variable PASSWORD but it appears it can only be set on app creation, not afterwards.

Finally, I looked at the Github and found the command bin/zope-passwd -p “password”. Note, this is for the docker image so I can’t verify it works elsewhere.

Source: Use custom.cfg to set admin password by winniehell · Pull Request #13 · senaite/senaite.docker

1 Like

Tks bro. Senaite docs are so confusing.

Unfortunately this failed for me on current senaite v2.5.0 with

zc.lockfile.LockError: Couldn't lock u'/data/filestorage/Data.fs.lock'

I found it is possible to edit via the Zope management interface:

https://your.host/acl_users/users/manage_users

Click Password to edit

1 Like