Debian 3CX Backup

Status
Not open for further replies.

Bigterrymuch

Forum User
Joined
Jun 11, 2019
Messages
5
Reaction score
0
I am trying to recover the administrator password on my 3CX system running on Debian via command line. I want to perform a backup operation of the database so I can read the password from it but I get the error:

root@chlorine:~# sudo -u phonesystem 3CXBackupCmd --help
find: Failed to restore initial working directory: /root: Permission denied

I have added phonesystem to the sudoers file as shown below:

# User privilege specification
root ALL=(ALL:ALL) ALL
phonesystem ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

And here is the entry for phonesystem in /etc/passwd file:

phonesystem:x:999:999::/var/lib/3cxpbx:

Kindly indicate where I am missing it
 
You can reset the password,

Given that you are running the latest version of the PBX the option becomes available in the login screen of the management console after a wrong password is used twice.
 
I managed to read the password in the XML file generated by the backup. However, it is still being rejected as a bad login. I am assuming the login name should be admin. Somebody please confirm if that is the case. Is there any possibility of changing the default admin login and how do I find the entry in the XML file
 
To recover the password, on the Debian Shell:
Bash:
root@LinuxPBX-V5:~# su - postgres

postgres@LinuxPBX-V5:~$ psql -d database_single -c "SELECT * FROM parameter WHERE name = 'WEBSERVERPASS'"

     name      |  description   | parametertype |     value      | idparameter

---------------+----------------+---------------+----------------+-------------

WEBSERVERPASS | The admin pass |             0 | MYSupersecret! |         253

(1 row)

postgres@LinuxPBX-V5:~$
 

Attachments

  • 3cx-recover-password.PNG
    3cx-recover-password.PNG
    41.5 KB · Views: 42
To recover the username, on the Debian Shell:
Bash:
root@LinuxPBX-V5:~# su - postgres

postgres@LinuxPBX-V5:~$ psql -d database_single -c "SELECT * FROM parameter WHERE name = 'WEBSERVERUSER'"

     name      | description  | parametertype | value | idparameter

---------------+--------------+---------------+-------+-------------

WEBSERVERUSER | The admin ID |             0 | admin |         254

(1 row)

postgres@LinuxPBX-V5:~$
 

Attachments

  • 3cx-recover-username.PNG
    3cx-recover-username.PNG
    32.7 KB · Views: 18
Hope you all enjoy the simplicity there. a 2 liner is about as good as it gets ;)
 
Last edited:
@BrenntG the 2-liner indeed worked. And my fears were confirmed as the username was not admin but something else. However I am not able to test it right away as my IP address is currently blacklisted due to too many incorrect login attempts. So I suppose have to find a different source IP or wait for the listing to time out unless somebody can give me a way around this.
 
We eventually managed to connect to the Console. Thanks to everyone for your support.
 
Status
Not open for further replies.

Forum statistics

Threads
111,928
Messages
589,771
Members
164,799
Latest member
RicoDinero