MyPBX change admin password at CLI (sqlite3)

Modified on Mon, 3 Oct, 2016 at 2:11 PM

MyPBX Standard V4 has an issue when updating from a very old firmware to latest in that the admin user password is mangled in the sqlite database. To remedy this we have to get direct access to the database. It is assumed that SSH has previously been enabled or you have serial access to the system, otherwise this technique will not work.


Tested on MyPBX Standard hardware version: MyPBX-Standard V4, firmware version: 2.18.0.22


From the command line we can edit the sqlite database directly.


# Open the database (if required find the database with command 'find / | grep MyPBX.sqlite')

sqlite3 /persistent/var/lib/asterisk/db/MyPBX.sqlite


# Switch on headers before listing the database entries

sqlite> .header on


# List the 'pwdsettings' database

sqlite> SELECT * FROM pwdsettings;


# Results

name|password|enable

admin|759f8c5febffed992456a2c3ca8aa791|0

cdr|5f4dcc3b5aa765d61d8327deb882cf99|0

user|5f4dcc3b5aa765d61d8327deb882cf99|0


# Enable the admin user

UPDATE pwdsettings

SET enable = 1

WHERE

  name = 'admin';


# Set the admin password to 'password'. Note it is set to the same as the 'cdr' & 'user' users which is 'password' by default.

sqlite> UPDATE pwdsettings

   ...> SET password = '5f4dcc3b5aa765d61d8327deb882cf99'

   ...> WHERE

   ...> name = 'admin';

   

# Quit sqlite3

sqlite> .quit



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article