forgot the freepbx login user/password

mezzo

New Member
Joined
Nov 20, 2007
Messages
5
Reaction score
0
hey all,

How do i change the freepbx admin password ? (and what is the username)
I tried all the passwd-* commands, I've wiped the wwwpasswd file clean, pretty much tried anything I can think of. Any help would be great... otherwise I need to do a complete reinstall :-(
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
admin / admin by default. We are using db access not .htaccess.

Joe
 

mezzo

New Member
Joined
Nov 20, 2007
Messages
5
Reaction score
0
so I need to login to sql and change the record for the admin user ?
(luckily I still know the root passwd)

EDIT: Nevermind, I found it... thnx for the help.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
If you ever get in a jam, you can create a new username and password for FreePBX by (1) creating a text file in your /root folder called newname.sh, (2) protect the file and make it executable (chmod 700 newname.sh), and (3) run it: ./newname.sh

Just cut-and-paste this sample of newname.sh which you can modify to create any username/password combination you like:

#!/bin/bash
mysql -uroot -ppassw0rd asterisk <<EOF
INSERT INTO ampusers
VALUES ('newuser','newpass','','','','*')
EOF

If you'd prefer to merely look up your existing usernames and passwords, use this script instead:

#!/bin/bash
mysql -uroot -ppassw0rd -t asterisk <<EOF
SELECT * FROM ampusers
EOF


 

RizSher

Guru
Joined
Oct 18, 2007
Messages
146
Reaction score
7
A very old one...

For some reason, I can't seem to access FreePBX anymore, any possible passowrd I could've used I've tried and failed. Have followed all sorts of guides on regaining access and failed. Finally followed Nerd's guide, and get the following:



mysql> select * from ampusers;
+----------+---------------+---------------+----------------+----------+----------+
| username | password_sha1 | extension_low | extension_high | deptname | sections |
+----------+---------------+---------------+----------------+----------+----------+
| admin | NEW_PASSWORD | | | | * |
| newuser | newpass | | | | * |
+----------+---------------+---------------+----------------+----------+----------+


however, neither admin, nor newuser work.... I still have my root password and can go onto CLI - anyway to reset things back?.

Appreciate any help.

ps: not using PiaF, another elasticky replacement :(
 

RizSher

Guru
Joined
Oct 18, 2007
Messages
146
Reaction score
7
Spent a good few hours with no luck, finally came across this link:

http://wiki.opencsta.org/index.php/..._in_database_for_admin_to_reset_lost_password

however, found I was getting an "Access denied for user 'root'@'localhost' errot, so merged intructions from the first linlk with this link: http://www.linuxquestions.org/questions/linux-software-2/error-1045-28000-access-denied-for-user-root@localhost-using-password-no-459578/

Create a php file:

[root@localhost ~]# nano new-freepbx-password.php

with the following:
Code:
<?php
  $newpassword = 'somethingNEW123';
  echo sha1($newpassword) ;
?>

Relace somethingNEW123 with whaetever you want your password to be, then

[root@localhost ~]# chmod a+x new-freepbx-password.php
[root@localhost ~]# php -f new-freepbx-password.php


4ae66o29caa73c1df52b483af56e636987b84ae5d

Note the whole 4ae66o.... number... or whatever you get as the output of the php -f command

[root@localhost ~]# /etc/init.d/mysqld stop

Stopping MySQL: [ OK ]
[root@localhost ~]# mysqld_safe --skip-grant-tables &
[1] 9050
[root@localhost ~]# Starting mysqld daemon with databases from /var/lib/mysql
[root@localhost ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use asterisk
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

Then issue the following command, take care to replace the 4ae66xxxxx string with whatever noted earlier.
mysql> update ampusers set password_sha1 = '4ae6629caa73c1df52b483af56e636987b84ae5d' where username = 'admin' limit 1 ;


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

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

[root@localhost ~]# /etc/init.d/mysqld restart
STOPPING server from pid file /var/run/mysqld/mysqld.pid
110817 15:39:20 mysqld ended

Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
[1]+ Done mysqld_safe --skip-grant-tables
 

Members online

No members online now.

Forum statistics

Threads
25,781
Messages
167,507
Members
19,201
Latest member
troutpocket
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top