Important Passwords to Change when Setting up Trixbox for First Use
There are several passwords that come the same in every version of Trixbox, so you will want to change these immediately to avoid security risks.
**NOTE: You will need to have Linux CLI experience and also know how to use a Linux text editor**
MySQL Passwords:
The first is the password for the MySQL user that the trixbox uses to make updates to its database; this user is named ‘asteriskuser’.
You’ll need to log into MySQL at the Linux CLI.
You will then be promoted for a password, the default password that is supplied with every Trixbox installation is:
‘passw0rd’ (with a zero)
You’ll then want to enter the following commands:
Where you would replace ‘new_pass_here’ with your desired password.
**NOTE: MySQL and the PBX Config does not like the exclamation point (!) character, so don’t use it in a password.**
Now doing this, will cause files that run Trixbox to not work correctly because they are set to use the old password, so we will have to update those as well.
Amportal.conf
First we need to edit the /etc/amportal.conf file to use the new password:
You need to find the line that says:
‘AMPDBPASS=amp109′
You will want to change the ‘amp109′ to the new password that you just set in MySQL. Please note that there are two places to set this password. The first one at the beginning of the file is commented out, while the second one is near the very end of the file, and that is the one that needs to be changed.
Save and exit the file.
Files that Use the MySQL Password:
Next we’ll need to change all the files that are utilizing the MySQL password, which specifically are:
- /etc/asterisk/cdr_mysql.conf (for call detail records)
- /etc/asterisk/res_mysql (honestly don’t know what this file does, but you have to update it)
- /var/www/html/maint/modules/cdrreport/config/database.php
You’ll want to do the same thing as when you edited the /etc/amportal.conf file, open the top two in a text editor, find the line that says ‘password=amp109′ and change the ‘amp109′ to the new password. Save and exit the files.
For the final file (/var/www/html/maint/modules/cdrreport/config/database.php), you’ll want to open it in a text editor just like the rest:
You’ll need to find the line that says ‘connection’ => ‘mysqli://asteriskuser:amp109@localhost/asteriskcdrdb’
Change the ‘amp109′ (shown in red above) to the asteriskuser password you set in MySQL.
Once you have edited those last two files, you’ll need to restart MySQL and the AMPortal (basically the Trixbox service) so that everything starts utilizing these passwords.
Now while not necessary, its definitely a good idea to also replace the MySQL root user password from its default. To do so, type the following:
Where ‘new_password_here’ is the new desired root user password (should NOT be the same as the asteriskuser). When you hit ‘Enter’ you’ll be prompted to enter a password, you’ll want to enter the default MySQL root password of ‘passw0rd’ (with a zero).
Now just like before, we’ll have to change a few files to use this new password.
First, you’ll want to edit the following file:
Search for the line that says ‘password=passw0rd’ and change it to the new password that you just set. Save and exit the file.
Next you’ll need to edit this file:
Edit the line that says $password = ‘passw0rd’; to $password = ‘your_new_mysql_root_password’; Save and exit the file.
Now all your passwords should be up to date, and you can restart MySQL one last time:














