How to Edit an Account Package or Owner from the cPanel Backend
Introduction
In some situations, you may have root SSH access to a cPanel server but not have access to WHM. If you need to change an account’s package, owner, or other account settings, you can do so by editing the account configuration file directly from the command line.
Prerequisites
Before you begin, ensure you have:
- Root SSH access to the server
- A server running cPanel/WHM
- Basic knowledge of editing files using a text editor such as
viorvim
Implementation
Step 1: Navigate to the cPanel User Directory
Log in to the server as the root user and change to the cPanel users directory.
cd /var/cpanel/users/
Step 2: Edit the Account Configuration File
Open the account file corresponding to the cPanel username.
vi cpanelacc
Replace cpanelacc with the actual cPanel username.
The file will contain entries similar to the following:
# cPanel — If you edit this file directly you must run # /usr/local/cpanel/scripts/updateuserdomains afterwards. BWLIMIT=unlimited CONTACTEMAIL=youremail@domain.tld DBOWNER=username DNS=domainname.tld FEATURELIST=default IP=1.1.1.1 LOCALE=en OWNER=root PLAN=default RS=x3 USER=username
Step 3: Modify the Required Setting
Update the appropriate value depending on your requirement:
- To change the hosting package, edit the
PLANvalue. - To change the account owner, edit the
OWNERvalue.
Save the file and exit the editor.
Step 4: Rebuild the cPanel Cache
After making the changes, run the following command to update the system cache and reflect the changes in WHM.
/usr/local/cpanel/scripts/updateuserdomains
Conclusion
If WHM access is unavailable, you can still update a cPanel account’s package or owner directly from the backend by editing the account configuration file in /var/cpanel/users/. After making the required changes, run the updateuserdomains script to ensure the changes are properly applied and reflected across the server.
