Introduction:
In web hosting environments managed through WHM/cPanel, administrators often need to suspend user accounts for various reasons such as non-payment, abuse, or maintenance. While this can be done easily through the WHM interface, system administrators often prefer using the Command Line Interface (CLI) for automation, scripting, or remote administration.
Steps to Suspend a cPanel Account via CLI
Step1:
Access WHM server using SSH as root user.
$ssh root@your-server-ip |
Step2:
Run the below WHMAPI Command to Suspend the Account.
$whmapi1 suspendacct user=USERNAME reason=”REASON_FOR_SUSPENSION” |
Example:
$whmapi1 suspendacct user=testuser reason=”XXXXX” |
Explanation of parameters:
user
→ The cPanel username of the account you want to suspend.reason
→ (Optional) A short note or description explaining why the account was suspended.
Step3:
We can confirm whether the account is successfully suspended by running.
$whmapi1 accountsummary user=USERNAME |
Look for the suspended: 1
status in the output.
Alternatively, we can check via the WHM interface under List Accounts, where the account will appear as Suspended.
Conclusion:
Suspending a cPanel account via CLI using WHMAPI is a quick and efficient method for administrators who manage multiple accounts or automate routine hosting operations. It eliminates the need to log in to WHM manually and helps integrate account control into scripts or monitoring systems.