Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Change PBX GUI Admin Password from Command Line

September 26, 2023
in Blog, FreePBX
0
ADVERTISEMENT

Table of Contents

If you forget your administrator login information for FreePBX, there is a simple way to log in and reset it. You will need your current root password (for SSH to Linux server) to proceed with this tutorial.

Reset Administrator Password from database

1️⃣ Assuming our new password is newpassword, type the following from Linux command prompt to create a encrypted password. We need it to update the password in the database instead of the cleartext one.

echo -n 'newpassword' | sha1sum | cut -d' ' -f1
[root@cs8 ~]# echo -n 'newpassword' | sha1sum | cut -d' ' -f1
f2c57870308dc87f432e5912d4de6f8e322721ba

2️⃣ fwconsole m This will connect you to the mysql database as the FreePBX user automatically based on the username and password for MySQL in /etc/freepbx.conf.

fwconsole m
[root@cs8 ~]# fwconsole m
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 128
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [asterisk]>

3️⃣ Get the list of users in the database. In our case, we need to change the password of the admin account.

select * from ampusers;
MariaDB [asterisk]> select * from ampusers;
+----------+------------------------------------------+---------------+----------------+----------+----------+-------+-----------+
| username | password_sha1                            | extension_low | extension_high | deptname | sections | email | extension |
+----------+------------------------------------------+---------------+----------------+----------+----------+-------+-----------+
| admin    | 3af3a6de22296db524f3e7c79816aaded2a3b727 |               |                |          | *        |       |           |
+----------+------------------------------------------+---------------+----------------+----------+----------+-------+-----------+
1 row in set (0.000 sec)

4️⃣ Now enter the following command from mysql command prompt mysql>. Don’t forget replacing the hashed password that you’ve created from step 1.

update ampusers set password_sha1 = 'e8c36c9b6fee0e438e15aa073349cf718ddd2f29' where username = 'admin' limit 1;
MariaDB [asterisk]> update ampusers set password_sha1 = 'f2c57870308dc87f432e5912d4de6f8e322721ba' where username = 'admin' limit 1;

Query OK, 1 row affected (0.001 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Now you should be able to log into the Admin GUI with username: admin, password: newpassword

Cannot login into the database

Additionally, if fwconsole m does not take you to the database. You can connect to the database manually with the login credentials from this file /etc/freepbx.conf.

[root@cs8 ~]# cat /etc/freepbx.conf
<?php
$amp_conf['AMPDBUSER'] = 'freepbxuser';
$amp_conf['AMPDBPASS'] = '629106146fc8d1a08371b9d81c24d920';
$amp_conf['AMPDBHOST'] = 'localhost';
$amp_conf['AMPDBPORT'] = '3306';
$amp_conf['AMPDBNAME'] = 'asterisk';
$amp_conf['AMPDBENGINE'] = 'mysql';
$amp_conf['datasource'] = ''; //for sqlite3

require_once('/var/www/html/admin/bootstrap.php');
?>

Replace AMPDBUSER with the value found in /etc/freepbx.conf or /etc/amportal.conf. When it asks for password, use the value of AMPDBPASS in the same files.

mysql -u freepbxuser -p 629106146fc8d1a08371b9d81c24d920
[root@cs8 ~]# mysql -u freepbxuser -p asterisk
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 197
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [asterisk]> select * from ampusers;
+----------+------------------------------------------+---------------+----------------+----------+----------+-------+-----------+
| username | password_sha1                            | extension_low | extension_high | deptname | sections | email | extension |
+----------+------------------------------------------+---------------+----------------+----------+----------+-------+-----------+
| admin    | f2c57870308dc87f432e5912d4de6f8e322721ba |               |                |          | *        |       |           |
+----------+------------------------------------------+---------------+----------------+----------+----------+-------+-----------+
1 row in set (0.000 sec)

MariaDB [asterisk]>

Not a reader? Watch this related video tutorial:

5/5 - (1 vote)
Previous Post

How to Find the Creation Date of a Microsoft 365 Tenant

Next Post

How To Check if Windows License in Retail or Volume

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory