Had to rescue a 3CX management console where the Whitelist IP address had changed and kept getting access denied with good credentials. The following process gave temporary access to change the Whitelist/Restricted IP address.
Caveats:
- 3CX hosted in Azure
- 3CX running Linux
- Didn’t know the Root password
Steps:
- Using Azure portal create a new root account using “Support + troubleshooting – Reset password” – This creates a new user in Linux with Root privileges. i.e. “3cxrescue”
- Using “Networking” create a new rule to allow SSH (TCP – Port 22) from your IP Address
- Perform a test connection using “ssh 3cxrescue@[your 3cx instance IP Address in Azure]” – enter password you just created. If ok then continue…. or troubleshoot why you can not do a simple SSH
- Using the following command create a SSH tunnel from a local port on your client machine to loopback to the 3CX instance. 3CX will allow local private addressing for access even if you have limited the console access before. The command is:
- ssh -L 5000:[127.0.0.1]:443 3cxrescue@[your 3cx instance IP Address in Azure]
- enter your password
- ssh session will remain open
- Note: this opens port 5000 on your local client listening for https web requests.
- On you client machine now connect using a web browser to http://localhost:5000
- Enter you existing 3CX admin details
- Navigate to “Security – Console Restrictions” and change the IP address as required.
- IMPORTANT: Check you can access management console as normal with public IP address.
- MUST – YOU MUST: Remove the Rule in Azure to allow SSH Connects to your Azure host.
btw: If you have lost the 3CX admin details:
- Stop 3CX VM in Azure
- Download the VHD from Azure.
- Mount the VHD – ignore prompt about format not being read by windows
- In a PowerShell session “wmic diskdrive list brief” – noting new “\\.\PHYSICALDRIVEx Microsoft Virtual Disk” (x number to be changed as required)
- Using WSL V2 enter the following command “wsl –mount \\.\PHYSICALDRIVEx –partition 1” (x number to be changed as required)
- Enter WSL and you will have access to your 3CX backup file in: “/mnt/wsl/PHYSICALDRIVExp1/var/lib/3cxpbx/Instance1/Data/Backups$”