Changing the Asterisk manager password

Changing the Asterisk manager password

Changing the username or password on 2.10 and beyond
If changing the username or password on 2.10 or beyond, you just go to Advanced Settings and make the change there. Everything else is done automatically an all the information below does not pertain.
Changing the username or password on 2.9
On 2.9, you no longer edit amportal.conf. That file is now generated and all settings are handled in Advanced Settings. Therefore you should make sure to make the changes in Advanced Settings first to assure it get's updated in the database. Then you can make the changes to the configuration files. If the "timing" isn't right, you may end up having to go into the Asterisk CLI and doing a reload to get everything updated.
Your best bet is to just upgrade to 2.10 first, then you can make the changes as described above which avoids complications.
Changing the username or password on older systems

If you are using the default password, you will see the message:

Warning: You are running FreePBX and Asterisk with the default manager pass. You should consider changing this to something else.

Running with the default password is a bad idea, simply because everyone else in the world knows it, and (if not properly firewalled, etc etc) could potentially connect to your asterisk box and do bad things(tm).

Warning: Don't get cute and try to use a password with non-alphabetic or non-numeric characters - things may break in strange ways if you try to use punctuation characters in passwords. Unless you really know what you are doing, stick to numbers and standard alphabetic characters. Also, you should probably read the comments below, to understand the importance of making a full backup before changing anything in case something goes wrong.

Changing the password

To do this, you need to edit two files: /etc/asterisk/manager.conf and /etc/amportal.conf

manager.conf

This controls the asterisk 'manager' users that are allowed to connect to the asterisk manager interface.

For full information on the file, see http://www.voip-info.org/wiki/index.php?page=Asterisk+config+manager.conf

You can have as many users in here as you'd like (for example, an operator panel might use one) and in fact, you should have different users for each application.

FreePBX requires a user that has a definition like the following:

[admin]
secret = secret123password
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

amportal.conf

There needs to be a corresponding entry in /etc/amportal.conf

AMPMGRUSER=admin
AMPMGRPASS=secret123password

Obviously you just need to use the same username (inside the square brackets) and password as above.

Once you have made the changes, you need to click on "Apply Configuration Changes" in order for the change to propagate throughout the system (If you don't see the orange "Apply Configuration Changes" bar, go to one of the GUI screens in the system and re-submit the page, no changes necessary). If you don't do this, then extensions_additional.conf will have stale data resulting in a broken phone system.

Comments

Cunk's picture

I tried changing my system's password following the steps here and wound up unable to direct calls (internal or external) to extensions. For some reason the dialparties.agi script was still pulling the default "amp111" password from somewhere and failing to authenticate. Once I undid the changes detailed above things went back to normal.

Very frustrating.

edit:
While looking at amportal.conf for another issue I noticed in the header that you have to run apply_conf after changing anything. I was unaware of this...maybe this should be added to the end of this FAQ.

edit2:
I also see now that the default password can be found in "extensions_additional.conf". I have to wonder what kind of trouble can be caused by not changing it there.

FEEDBACK COMMENT: it is included in extensions_additional.conf which is auto-generated. See comment above added that you need to press "Apply Configuration Changes" have that change occur.

Blackthorn's picture

When you log into the freepbx web gui it gives you a notice that you need to change the passwords. You do a search on how to change it and the very first FAQ says "how to change the password". So you say great. It says change the password in two files and that is it. So you say ok that is easy enough and you make the change reboot. And then you get prompted with the unable to connect to database error. So you go searching and you find this site where people say don't change the passwords use a firewall etc etc. I've tried putting the original passwords back into the files that I modified and still get can not connect to database. Along with this issue and a few others I'm done working with this software. I'll go back to my Asterisk 1.6 at least it works without having someone fuss at you after you were lead on by the "security" alerts by the software.

FEEDBACK COMMENT: The security warnings are to make you aware you are using default information. If you made changes that broke the system, and then reverted those changes and the system is still broken, it would appear that there is something that was missed when reverting. That is unfortunate. Also, if you are getting messages that you can't connect to the database, then it would appear that you may have inadvertently made changes to the AMPDBPASS or related amportal.conf settings, which have different default values then the manager.

egren's picture

I have same problem. I have freepbx 2.7.0.11. I changed "secret" for [admin] in /etc/asterisk/manager.conf and AMPMGRPASS in /etc/amportal.conf and I get this error:

***

Reload failed because retrieve_conf encountered an error: 1

exit: 1
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for /etc/amportal.conf ..OK
Bootstrapping /etc/amportal.conf ..OK
Parsing /etc/amportal.conf ..OK
Parsing /etc/asterisk/asterisk.conf ..OK
Connecting to database..OK
PHP Warning: Missing argument 1 for connectdirs::create(), called in /var/lib/asterisk/bin/retrieve_conf on line 434 and defined in /var/lib/asterisk/bin/retrieve_conf on line 13
Connecting to Asterisk manager interface..Sun, 06 May 2012 17:37:16 +0200 - Unable to connect to manager 127.0.0.1:5038 (111): Connection refused
FAILED
[FATAL] Asterisk Manager Connection Failure Failed to connect to the Asterisk manager through port: 5038

***

I've tried putting the original password (amp111) back into the files that I modified and still get the same error.

What could I do to repair my system?

Thank you.

templewolf's picture

Hi all,

New user alert go easy on me if this has been posted already.

I followed the above instructions also, but while I was perusing the above files I made notes of the other accounts and passwords found in the system (so far... I told you I was new.)
The one that let me into the admin module was user: freepbx and password: fpbx.
Hope this helps, and thanks to the people who obviously worked so hard to produce this software.

Peace,
templewolf

fskrotzki's picture

tempwolf, that must have been a username and password you picked or was one that was pre-configured from a distro that you used to build the system as it's not a stock username and password.

jay123's picture

It does not work at all as I have followed all the guides here. I'm not able to make any calls.

Please help to solve. Thank you

juangabriel's picture

Thanks to this I'm doing very well with linux. I'm an open mind windows guy. I found this little amp111 in this files:

/etc/asterisk/manager.conf
/etc/amportal.conf
/var/lib/asterisk/agi-bin/user_login_out.agi
/var/www/html/admin/modules/core/agi-bin/user_login_out.agi
/var/www/html/framework/modules/trixbox/libraries/Trixpbx.php
/var/www/html/maint/modules/asterisk_info/asterisk_info.php
/var/www/html/admin/modules/framework/htdocs/admin/functions.inc.php
/var/www/html/admin/modules/endpointcfg/framework/modules/trixbox/libraries/Trixpbx.php
/var/www/html/admin/functions.inc.php
/etc/asterisk/extensions_additional.conf
/usr/scr/tbm-pbxconfig-5.5.1/amportal.conf
/usr/scr/tbm-pbxconfig-5.5.1/install_amp

this is free I think in all this cases.... my next step is go file by file trying calls and everything and we'll see.

If somebody knows a better solution like a automated module to change main passwords?

Now what about to change "amp111" in all the files? and I mean ALL the files? with something like this:

find / -name *|xargs perl -w -i -p -e "s/amp111/newpassword/g"

some time I read if you change the password in the file where the trixbox compare the used one with. I mean it needs to compare with something to know if it's the default or isn't. But if you change it there to, you are gonna keep seeing the warning message but from the security side you are gonna be safe because this is a new one....

fskrotzki's picture

juangabriel,

Please be careful as 1. you are using a trixbox setup which has extra files and they should have there own password changing routine (did for versions pre 2.6 at least). 2. you are using the bastardized version of trixbox where they forked FreePBX and didn't provide the "bug fixes" they said existed and fixed. 3. they bumped the version numbering system to 5.5 which means there is no known way to roll back to a real version of FreePBX, so much of the potential information you are providing can be misleading to the rest of the FreePBX user base.

Also that is the one problem with using Distro's. They add options and/or features past FreePBX which might need those passwords and it is then up to those distro providers to document the proper way to change the password as they have now created extra reliances on a password that FreePBX would not know about. Yes many of the smart ones make it read from the amportal.conf file so that if it get's changed it knows about it but not all do as those authors are then typing themselves to FreePBX which some don't consider a good thing....

hosdes's picture

I have /etc/asterisk/manager.conf file but not a amportal.conf file. Using freepbx 2.5.2.2 and asterisk by repos for ubuntu 8.04. what should I do

hosdes's picture

sorry yes I do it is /etc/amportal.conf. changed passwords.

mizraith's picture

I have the same issue as templewolf. With a brand new FreePBX install (AsteriskNOW distro), I get stuck with the "freepbx" user and "fpbx" password and the interface squawks, but there seems to be no way to change or edit the 'freepbx' admin user.

How do I change that password? I've looked in /etc/amportal.conf and it links to the SQL database. When changed, I lose my database connection. Is there a way to change it from within the web interface of freepbx?

parknook's picture

http://www.freepbx.org/support/documentation/faq/changing-the-mysql-password

Once you've changed the SQL password you can then change the AMPDBPASS in /etc/amportal.conf

It worked for me - Perhaps that page should make reference to "This is how you change the default freepbx/fpbx" then google would list it!

gpanula's picture

Below are the files on my 2.6 trixbox that I needed to update. These files held the password for the "asteriskuser"; used to connect to mysql on the localhost.

The files are:

* /etc/asterisk/extensions_additional.conf
* /etc/asterisk/manager.conf
* /etc/asterisk/phpagi.conf
* /etc/amportal.conf
* /var/www/html/maint/modules/asterisk_info/asterisk_info.php
* /var/www/html/maint/modules/cdrreport/config/database.php
* /etc/asterisk/cdr_mysql.conf

And this bit of command-line fu will change them all at one go.

sed -i -e 's/amp111/newpassword/g' /etc/asterisk/extensions_additional.conf /etc/asterisk/manager.conf /etc/asterisk/phpagi.conf /etc/amportal.conf /var/www/html/maint/modules/asterisk_info/asterisk_info.php /var/www/html/maint/modules/cdrreport/config/database.php /etc/asterisk/cdr_mysql.conf

Hope this helps. this is really for my own reference Smile

wiztech's picture

I followed the instructions exactly (and rebuilt the box 3 times)

I am left with the following error:

exit: 1
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for /etc/amportal.conf ..OK
Bootstrapping /etc/amportal.conf ..OK
Parsing /etc/amportal.conf ..OK
Parsing /etc/asterisk/asterisk.conf ..OK
Connecting to database..OK
Connecting to Asterisk manager interface..Sat, 23 Apr 2011 08:47:08 -0500 - Unable to connect to manager 127.0.0.1:5038 (110): Connection timed out
FAILED
[FATAL] Asterisk Manager Connection Failure Failed to connect to the Asterisk manager through port: 5038
1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.

Asterisk Manager Connection Failure

Failed to connect to the Asterisk manager through port: 5038
Added 0 minutes ago
(retrieve_conf.FATAL)

retrieve_conf failed, config not applied

Reload failed because retrieve_conf encountered an error: 1
Added 0 minutes ago
(freepbx.RCONFFAIL)

I have successfully changed the password through tinkering, but was trying to actually document the process and can now not reproduce a successful change.

The only difference is that I've been running update-fixes prior to doing these latest builds where I just installed off the purple / proxmox appliance template for the first setup.

You can go revert back and have a working system by changing the amportal.conf, manager.conf and the "admin" account in Administrators back to the default password of "amp111"

...

I'll post again when I get this thing working 100%

blackc2004's picture

I get the same error when I try to update the password. Why can't this documentation be updated to be correct?

Does anyone have the right way to update the password?

I'm running AsteriskNOW with 1.8 and Freepbx 2.7.0.10

meuch_13's picture

I was able to change it, it seems that editing manually the "/etc/amportal.conf" file does not work on newer version of FreePBX. (2.8 and 2.9) So here the procedure I used:

Once you have the password changed in the /etc/asterisk/manager.conf, restart asterisk (on CentOS, service asterisk restart)

Then go to the Web portal, in the tab "Tools" there is a section called "Advanced Settings"

Select the radio button "yes" for "Display Readonly Settings" and "Override Readonly Settings", apply then change (the green check marck that appear next the edited line)

The change the "Asterisk Manager Password" to the same value as the manager.conf file. Applied the change. (Note: using FireFox 4, the green checkmark does not disappear for some reason until you reload the service)

The apply the configuration changes (if the orange box does not appear, just click on an other tab, it will show) and you are done.

rsavoie's picture

Yes! Thanks 'tadpole'! Your solution worked for me!

I'm not sure exactly how this problem occurred and why it's biting so many people.
The message popped up after I upgraded to 2.9.0.7. Could it be related to PBX in a Flash? FYI.. I'm running Asterisk 1.8.3.2 on Centos 5.6.

~Ray

TrumpsNZ's picture

I am using 2.9 and had tried all sorts of things to try and get this error to work.

I used the Webgui as explained in this post to change it which gives you an error (you just leave the error). You then change amportal.conf and manager.conf as explained and restart asterix as you just explained (terminal: amportal stop -> amportal start).

Once you have restarted it will let you confirm the configuration changes from the webgui and it will now work.

Ssahin's picture

Hi all.

I always have problems in this subject.
(Changing the all password )

Do not have a Script to do this job ?

thanks

cardy_c's picture

FreePBX 2.9.0.7

None of the above is working for me either!!!

Andre81's picture

Hi @ all,

I have the same damnt problem.

when you change passwords in configuration files and in mysql databases you think that you have done all work, but nothing working...

so, if you check the word amp109 and amp111 you can see that this passphare are used in many file; it seems that instead of recall configuration file, the php file have inside the password.
Two example:

this is for amp109 password


[pbx1.local ~]# grep -r "amp109" /var/www/
/var/www/html/framework/system/config/database.php: 'pass' => 'amp109',
/var/www/html/framework/modules/trixbox/libraries/Trixpbx.php: 'AMPDBPASS' => array('std' , 'amp109'),
/var/www/html/admin/functions.inc.php.orig: 'AMPDBPASS' => array('std' , 'amp109'),
/var/www/html/admin/modules/framework/var/www/html/admin/functions.inc.php.orig: 'AMPDBPASS' => array('std' , 'amp109'),
/var/www/html/admin/modules/framework/var/www/html/admin/functions.inc.php: 'AMPDBPASS' => array('std' , 'amp109'),
/var/www/html/admin/functions.inc.php: 'AMPDBPASS' => array('std' , 'amp109'),
/var/www/html/maint/modules/cdrreport/config/database.php: 'connection' => 'mysqli://asteriskuser:amp109@localhost/asteriskcdrdb',
[pbx1.local ~]#

this is for amp111 password


[pbx1.local ~]# grep -r "amp111" /var/www/
/var/www/html/framework/modules/trixbox/libraries/Trixpbx.php: 'AMPMGRPASS' => array('std' , 'amp111'),
/var/www/html/admin/functions.inc.php.orig: 'AMPMGRPASS' => array('std' , 'amp111'),
/var/www/html/admin/modules/framework/var/www/html/admin/functions.inc.php.orig: 'AMPMGRPASS' => array('std' , 'amp111'),
/var/www/html/admin/modules/framework/var/www/html/admin/functions.inc.php: 'AMPMGRPASS' => array('std' , 'amp111'),
/var/www/html/admin/modules/core/agi-bin/user_login_out.agi: $ampmgrpass = 'amp111';
/var/www/html/admin/functions.inc.php: 'AMPMGRPASS' => array('std' , 'amp111'),
[pbx1.local ~]#

My question is: if the previous file use the standard password, I have to change in every single file the password in order to reach the goal?

thanks

Andrea

p.s. sorry for my english

mickecarlsson's picture

@Andre81, you are using trixbox, that distro is a waste of time.

Almost every file in your finding are from their 'framework' or from a very old FreePBX that they "forked".

Also, for amp109 and amp111:

'AMPMGRPASS' => array('std' , 'ampxxx'),

That is valid piece of code, that means that the AMPMGRPASS is an array that can be set elsewhere, but the default is ampxxx.

Mikael Carlsson
(I am off-line, tinkering with my Chevy and my radios, don't know when I will be back)

Andre81's picture

hi thanks for your reply, but I'm courious about why trixbox is a waste of time.
My trixbox for personal use seems to be ok...

SkykingOH's picture

trixbox used to be the premier distribution of FreePBX and Asterisk, then they decided to fork the project and "improve" it. Fast forward two years later, no updates and Fonality has stuck their users with unsupported, out of date software. You also can't even update as their repositories are all screwed up.

Why would you want to use that, even for personal use?

TimMillerDyck's picture

Hi, thanks to meuch_13's tip above. Here is the procedure for FreePBX Distro 2.10 beta2.

This process will change the "admin" manager user password in amportal.conf, extensions_additional.conf and manager.conf

Open the FreePBX web administration console.

Configure the Advanced Settings display settings to show the "Asterisk Manager" settings.

* Settings > Advanced Settings
* Display Readonly Settings: set to "True"
* click the "Save" green check mark right next to the field
* Override Readonly Settings: set to "True"
* click the "Save" green check mark right next to the field
* Apply Config

The "Asterisk Manager" section is now visible and editable.

* Asterisk Manager Password: change the default "amp111" to a desired new password -- use only numbers and letters in the password
* click the "Save" green check mark right next to the field
* don't click "Apply Config" yet

* Edit manager.conf to change the default "amp111" password for the "admin" user to the same password used above

vi /etc/asterisk/manager.conf

...
[admin]
secret = amp111
...

* Restart FreePBX so the upcoming "Apply Config" will work using the new password

amportal restart

* Now click "Apply Config"

And set the Advanced Settings display settings back again.

* Display Readonly Settings: set to "False"
* click the "Save" green check mark right next to the field
* Override Readonly Settings: set to "False"
* click the "Save" green check mark right next to the field

* choose "Settings > Advanced Settings" again
* Apply Config

pezzz's picture

Thanks Tim,
This worked for me.
I am finding the guides are not 100% up to date with the new layout of FreePBX and seem to relate back to the versions i am used to seeing in Trixbox.
Muddling my way through though and really liking this Distro.

TimMillerDyck's picture

The race condition bug that required the ordering above has been fixed as of http://www.freepbx.org/trac/ticket/5117 and 2.10rc1.1.

The procedure is now much simpler:

--

This controls the users that are allowed to connect to the asterisk manager interface. There is one such user, named "admin", defined by default. This process will change the "admin" manager user password in /etc/amportal.conf, /etc/asterisk/extensions_additional.conf and /etc/asterisk/manager.conf.

Open the FreePBX web administration console.

Configure the Advanced Settings display settings to show the "Asterisk Manager" settings.

    Settings > Advanced Settings
        Display Readonly Settings: set to "True"
            click the "Save" green check mark right next to the field
        Override Readonly Settings: set to "True"
            click the "Save" green check mark right next to the field
        Apply Config

The "Asterisk Manager" section is now visible and editable.

    Asterisk Manager Password: change the default "amp111" to a desired new password – use only numbers and letters in the password
        click the "Save" green check mark right next to the field
    Apply Config

And set the Advanced Settings display settings back again.

    Display Readonly Settings: set to "False"
        click the "Save" green check mark right next to the field
    Override Readonly Settings: set to "False"
        click the "Save" green check mark right next to the field

    choose "Settings > Advanced Settings" again
        Apply Config

borntochill's picture

After installing PIAF 2.0 with Free PBX 2.9, CentOS 6.2, everything was running fine. I hadn't yet made any changes to configuration and had no warnings in the FreePBX Notices box.

I then installed Incredible PBX 3.0 and got the "Default Asterisk Password Used" warning in Notices upon boot.

I tried doing TimMillerDyck's procedure above. When changing the default "amp111" to my desired password and hitting "Save" I got an Ajax error. I hit Apply Config anyway. The orange "Please wait, reloading" came up and then stayed up forever frozen.

When I rebooted, I had the red warning indicator that Asterisk was not running.

In the FreePBX Notices box, I get:

retrieve_conf failed, config not applied
Reload failed because retrieve_conf encountered an error: 1
Added 24 minutes ago
(freepbx.RCONFFAIL)

as well as the "Default Asterisk Manager Password Used" message.

The orange Apply Configuration Changes bar is still there. When I hit it, it locks up again stuck forever on the "Please wait, reloading" screen.

I tried stepping through TimMillerDyck's procedure in his earlier message modifying /etc/asterisk/manager.conf midway. Same problem occurs. Freezes on "Please wait, reloading" screen whenever selecting Apply Configuration Changes.

This occurs accessing FreePBX UI in both Firefox and IE.

I'm a FreePBX and Linux newbie. Don't have any idea where to go from here.

rem1473's picture

Wow, do I wish that I had scrolled down to read all the comments on this page before mucking with my system. I tried the procedure indicated at the very top, and broke my phone system. I was able to reverse all the changes, and everything was working again. I decided to read all the comments. I got all the way to the bottom and decided to try TimMillerDyck's procedure and that worked perfectly. I am using FreePBX 1.8, downloaded on 3/1/2012. I have also updated all my packaged and kept the system up to date since the install.

w14219's picture

I just use the procedure for FreePBX 2.10.0.1. It worked!

Thank you

dsch's picture

I have the AsteriskNow loaded up. Configured other passwords. Checked for upgrades. Upgraded twice. Modules report 2.10.0.xx. Services are green. Only one bell message "Default Asterisk Manager Password Used".

Tried to update with advanced settings. Clicking save gives the following javascript error:
Line: 45
Error: Unable to get value of the property 'validated': object is null or undefined

If I ignore that and go into Advanced Settings again I see the value is what I changed. I click Apply Config and get:

Reload failed because retrieve_conf encountered an error: 1
exit: 1[FATAL] Unable to connect to Asterisk Manager from /var/lib/asterisk/bin/retrieve_conf, aborting

If I change back to the default password and ignore the javascript message and Apply Config, it is back to normal. With it still under the default password.

Asterisk Info 2.10.0.1
System Dashboard 2.10.0.3

Please let me know what I am missing.

Thanks
Donald

SkykingOH's picture

Did you read the whole thread? The original post is wrong.

Just set your freepbx.conf and manager.conf to match then run an 'amportal restart' to commit the changes. Can't do fro GUI

dsch's picture

and I skipped that answer since I had upgraded to 2.10.

Thanks for straighting me out. That worked great.

fpuello's picture

Hello there,

I just installed Asterisk 1.8.10.1 and FreePbx 2.11.0.1 over Ubuntu 12.04.

My problem is that it never has asked me for a password when I enter into the GUI (192.168.1.25/asterisk).

I have changed it on the Advanced Settings and I can confirm that it changes on manager.conf, amportal.conf and extensions_additional.conf. After applying changes and restarting asterisk it still doesn't ask for a password.

I have also tried the process indicated by TimMillerDyck with same results.

Any ideas so it ask for a password?

Thanks,
fpuello