Skip to content

Suspending a cPanel account for abuse — the postmortem-friendly workflow

How to suspend a cPanel account when abuse is detected, preserve the evidence, communicate with the customer, and produce a postmortem worth reading.

Account suspension is the operator’s emergency brake. It stops the bleeding (outbound spam, defacement payload, resource exhaustion) but it does not solve anything. The mistake is using whmapi1 suspendacct without preserving evidence first. By the time the customer asks “what happened,” the answer is “we don’t know, we suspended, we cleaned, please be more careful.” That answer ends customer relationships.

What’s happening

whmapi1 suspendacct user=<user> puts the account in a suspended state: web requests return a “Suspended” page, mail bounces, FTP refuses. The user data on disk is preserved but inaccessible to the user. Some operators add a custom reason, some send an automated email, some just suspend silently. The postmortem-friendly version captures the state of the world before stopping the bleed.

How to verify

whmapi1 listsuspended
whmapi1 accountsummary user=<user>
ls -la /var/cpanel/users/<user>
ls -la /var/cpanel/suspended/<user>
grep <user> /var/log/exim_mainlog | wc -l

The exim count tells you whether the account is currently spamming, recently spammed, or quiet.

The fix

A 7-step suspension that produces a postmortem you can defend:

  1. Snapshot before suspension. tar czf /backup/abuse/<user>-$(date +%Y%m%d).tar.gz /home/<user>/public_html /home/<user>/mail /var/cpanel/users/<user> (or rsync to a quarantine area). This is your evidence.
  2. Mail queue snapshot: exim -bp > /backup/abuse/<user>-mailq-$(date +%Y%m%d).txt. The queue itself is evidence.
  3. Apache access log slice: awk '/<user>/' /etc/apache2/logs/access_log > /backup/abuse/<user>-access-$(date +%Y%m%d).txt.
  4. Auth log slice: grep <user> /var/log/secure /usr/local/cpanel/logs/access_log > /backup/abuse/<user>-auth-$(date +%Y%m%d).txt.
  5. Now suspend: whmapi1 suspendacct user=<user> reason="abuse-investigation-$(date +%Y%m%d)". The reason field shows in WHM and is useful for the postmortem.
  6. Email the account contact with: what was detected, when, what evidence we are holding, what the customer needs to do to re-enable. Use a template.
  7. Postmortem within 48 hours: cause (compromised plugin, weak password, etc.), evidence pointer (the tar above), what we changed (WAF rule, plugin disabled, account password reset), what the customer must do (update WordPress, rotate credentials, enable 2FA).

Stack Harbor maintains this workflow as part of cPanel server management.