The current method to changing the superadmin password is actually to make a new superadmin user name and password.
In older installations of FusionPBX config.php is located in /var/www/fusionpbx/resources/
- Move the config.php file temporarily.
cd /etc/fusionpbx mv config.php config1.php cat config1.php | grep password
- Go to the FusionPBX install login page in the web browser. This will put FusionPBX into a recovery mode. Choose the language for your region and click next.
You will type in your web browser either the ip hxxps://xxx.xxx.xxx.xxx or the domain name hxxps://sub.domain.tld .
- In this step, you create what you want for the new superadmin user and password. It has to be a user and password that does not already exist.
- Database Host, Database Port, Database name should be pre filled. To provide the Database Username and Database Password you will have to locate those in the config.php file that we moved eariler. The code block below shows an easy way to retrieve the database password. Once those are filled in click next.
cd /etc/fusionpbx cat config1.php | grep password $db_password = 'databasepasswordfromconfig.php';
- You should have a new config.php file in the /etc/fusionpbx/ directory. Proceed to login to with the new superadmin user name and password.
Old Password Reset¶
echo '<?php $salt = "random-salt-goes-here";$password = "put your password here"; echo md5($salt.$password)."\n"; ?>' > /tmp /test.php
- \l to list the databases.
- \c to connect to one of them.
- After running the SQL Query then use q to quit.
su postgres psql \c fusionpbx
Change the Password¶
The hashed password and the salt can be updated using the command:
update v_users set password = 'replace-with-password-hash-from-php-script', salt = 'replace-with-your-random-salt' where username = 'superadmin';