Reset Admin Password on FreePBX from the Command Line
-
So you lost your password to your FreePBX system and need reset it from the command line. You can do this pretty easily from the mysql client (or from a tool like phpMyAdmin) like so:
mysql -D asterisk -e "UPDATE ampusers SET password_sha1='e1edd0771b6345f00b5557b98b2bde8fd66744c5' WHERE username='admin'"
You need to change the username from "admin" to whatever you have set as your admin if this is not the name that you have used. Most people use "admin" by default. The command above will change this user's password to "iforgotmypassword". Don't keep this, just log in and change it once you have gotten this fixed.
-
@scottalanmiller said in Reset Admin Password on FreePBX from the Command Line:
mysql -D asterisk -e "UPDATE ampusers SET password_sha1='e1edd0771b6345f00b5557b98b2bde8fd66744c5' WHERE username='admin'"
Why on earth do you give an instruction with a hash in it?
Why not use the MySQL SHA1() function?
mysql -D asterisk -e "UPDATE ampusers SET password_sha1=SHA1('CHANGEME') WHERE username='admin'"