Administrator account permissions accidentally removed

While trying to troubleshoot a problem with logging into iSymphony, it occurred to me that my admin account might not have access to it. So I did the following:

Went into Settings>Administators
Clicked on the iSymphony item in the access permissions box
Hit submit
Applied config.

I should have added “Think things through” before the Hit submit item.
Now my only admin account on the system only has access iSymphony, System status, and ucp. Nothing else.
Is this installation completely hosed, or can I recover from this?

My thought when doing this was I just needed to add a permission since the account had everything else. I didn’t realize it would allow someone to remove critical permissions even if there was only one admin.

Did you search the forums here? That has been
n answered many times. It’s also in the wiki, you should read that one day .

I’m aware this is an old thread but have done exactly the same thing as the OP after installing iSymphony, so not sure if starting a new thread is appropriate (I assume this is a moot point now I’ve also provided a solution).

I have spent nearly 6 hours reading almost the entire Wiki and another 4 hours into the early hours using google to try and find some information on editing admin privileges (or permissions, or access levels etc… and many other phrases to try and find something) and everything just points back to this and one other very similar post - everything is geared up towards lost passwords.

The command line tool that ‘unlocks’ the installation works perfectly, except I just get the same permissions as my now useless admin login, so just see the help, User, and iSymphony buttons at the top, any administration controls are hidden, which is exactly what I accidentally configured in the same manner as the OP.

This isn’t a production device and I have a backup of course, but it was made a day before I spent quite a bit of time creating a rather large demo IVR, so would appreciate being able to do a rescue rather than a reinstall.

I’m running the full RasPBX image / distro with all available updates as of yesterday and FreePBX states version 12.0.71. Thanks in advance for any help.

UPDATE:

Thanks to a quick MySQL crash course, I found the answer, or an answer anyway - (http://www.cyberciti.biz/faq/mysql-command-to-show-list-of-databases-on-server/)

I accessed the database called ‘asterisk’ using the username and passwords contained at amportal.conf

I then issued a UPDATE ampusers SET sections = '*' WHERE username = '[myusername]'

Previously ‘sections’ was set to a single value which was cxpanel_menu which as I knew myself was why I couldn’t do anything other than see the userpanel and iSymphony.

I hadn’t touched a command line since ditching my Archimedes in 1998 and know nothing of Linux so not bad for someone that first picked up a Pi 3 weeks ago I thought, although I appreciate db hacking about is not good practice. I won’t be making this silly mistake again anyway.

Thanks @datadiffusion this saved me today too after a similar permissions mistake

For the next guy, here’s what to do line by line:

SSH to FreePBX then:

mysql -u root -p
USE asterisk;
UPDATE ampusers SET sections = '*' WHERE username = 'admin';

Change username as needed

1 Like