How to unsuspend a cPanel Account via CLI Using WHMAPI?

  Uncategorized

Introduction:

Managing cPanel accounts efficiently is a core task for web hosting administrators. Occasionally, accounts are suspended due to overdue payments, policy violations, or security issues. While WHM provides a graphical interface to suspend or unsuspend accounts, performing these tasks via the command line interface (CLI) can save time, especially when dealing with multiple accounts or automating server management tasks.

Prerequisites:

  1. SSH root credentials.
  2. Username of the cPanel account to unsuspend.

Steps to Unsuspend a cPanel Account via CLI.

Step1:

Access the WHM server using SSH as root user.

$ssh root@your-server-ip

Step2:

Run the below WHMAPI Command to unsuspend the Account.

$ whmapi1 unsuspendacct user=USERNAME

Example:

$ whmapi1 unsuspendacct user=Client123

Explanation of parameters:

USERNAME is the cPanel account username.

Step3:

We can confirm whether the account is successfully suspended by running.

$ whmapi1 accountsummary user=cpanelusername | grep suspend

Output:

suspended: 0 # 0 = active, 1 = suspended

Conclusion:

Using the WHM API via CLI to unsuspend cPanel accounts offers a fast, reliable, and scriptable approach for server administrators. It eliminates the need to manually navigate WHM’s graphical interface and allows for bulk operations, automation, and integration with server management scripts.

LEAVE A COMMENT