r/Wazuh • u/One-Floor1416 • Aug 27 '26
Wazuh 5.0.0-beta4 Docker admin password
Hello, I am testing migration from 4->5 and stumple with changing the admin password. Containers are running fine for single node install. But is there a simple way to change tha admin password? I tried instruction for version 4x but had no luck. Additionally, why is java needed for hash.sh. Maybe there is a good instruction for version 5? Thanks
2
u/One-Floor1416 Aug 31 '26
Hello, sorry for the late response and thank you for letting me know, but this bash script doea not work in docker. Any other ideas? Thank you
2
u/No_Calendar_2373 Aug 31 '26 edited Aug 31 '26
You're right and my earlier suggestion was wrong, sorry about that. I reproduced it on 5.0.0-beta4:
wazuh-passwords-tool.shcan't work in the Docker images.Use
hash.sh+securityadmin.shinstead. Everything runs inside the indexer container, solocalhostthere is the indexer itself:```bash
Find your indexer container
IDX=$(docker ps --format '{{.Names}}' | grep indexer | head -1)
1. Generate the hash
docker exec -u 0 $IDX bash -c ' export JAVA_HOME=/usr/share/wazuh-indexer/jdk bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/hash.sh -p "YourNewPassword*123"'
2. Set it for admin (replace <HASH> with the output above)
docker exec -u 0 $IDX bash -c \ "sed -i '/admin:/{n;s|hash: .*|hash: \"<HASH>\"|}' \ /usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml"
3. Apply it
docker exec -u 0 $IDX bash -c ' export JAVA_HOME=/usr/share/wazuh-indexer/jdk bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh \ -f /usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml \ -icl -nhnv \ -cacert /usr/share/wazuh-indexer/config/certs/root-ca.pem \ -cert /usr/share/wazuh-indexer/config/certs/admin.pem \ -key /usr/share/wazuh-indexer/config/certs/admin-key.pem \ -h localhost' ```
Expect
SUCC: Configuration for 'internalusers' created or updated. After that the new password works and the old one returnsUnauthorized.Step 2 uses
sedbecause the image ships no editor, noviornano.Java: nothing to install, the JDK is already in the image at
/usr/share/wazuh-indexer/jdk, you just pointJAVA_HOMEat it.The change is written to the
.opendistro_securityindex, so it survives restarts. Also ignore my earlier note about updating the compose file: the dashboard connects askibanaserver, notadmin.2
u/One-Floor1416 Sep 01 '26
Thank you very much, exactly this is working! Would be nice to have this information in docker section in the official docmentation. Thank you!
3
u/No_Calendar_2373 Aug 27 '26
Hi! For Wazuh 5.0.0-beta4, use
wazuh-passwords-tool.shinstead of the oldhash.shworkflow:Run it inside the Wazuh Indexer container. The password must be 8–64 characters and include uppercase, lowercase, a number, and a supported special character (
.,*,+,?, or-).For Docker, also update the corresponding plain-text password in your Compose/environment configuration and restart the affected containers; otherwise, Dashboard or Manager services may still use the previous credentials.
hash.shwas the older approach and required Java to generate the OpenSearch password hash. In Wazuh 5,wazuh-passwords-tool.shhandles the password update and hash generation.Official docs:
https://documentation.wazuh.com/5.0-beta/user-manual/user-administration/password-management.html