Tuesday, December 19, 2017

How to change the super admin password in WSO2 products

If you want to change the existing super admin credentials in any WSO2 product, without login to the server, you can use the chpasswd scripts provided in the pack.

Super admin credentials are saved in the default user store configured in user-mgt.xml. If the default primary user store uses JDBC database (by default it's H2) by running above script will change the stored admin credentials in the database.

Please find the sample command to execute change super admin credentials.

First go into the PRODUCT_HOME directory (ex :  /Users/chamara/wso2/products/esb/wso2esb-4.8.1/)

Then run below command. Here, I am having default H2 database as a primary JDBC user store.

Syntax

./chpasswd.sh --db-url "jdbc:h2:PRODUCT_HOME/repository/database/WSO2CARBON_DB" --db-driver org.h2.Driver --db-username DB_USERNAME --db-password DB_PASSWORD --username admin --new-password NEW_PASSWORD


Sample

./chpasswd.sh --db-url "jdbc:h2:/Users/chamara/wso2/products/esb/wso2esb-4.8.1/repository/database/WSO2CARBON_DB" --db-driver org.h2.Driver --db-username wso2carbon --db-password wso2carbon --username admin --new-password admin123

No comments: