This guide is intended for cPanel and WHM server Admins that would like to terminate user accounts from a command-line interface. Account termination is permanent and should only be used by experienced server administrators.
Terminating Accounts with /scripts/removeacct
The /usr/local/cpanel/scripts/removeacct script terminates cPanel accounts from the command line.
To use the /usr/local/cpanel/scripts/removeacct script to terminate a cPanel account from the command line, login to the server as root user and run the following command (replacing "username" with the username of the account to terminate):
/usr/local/cpanel/scripts/removeacct username [options]
Options
When you run the /scripts/removeacct script, you can specify the following options:
--force Bypass the confirmation step in the script and immediately terminate the account.
ex.
/usr/local/cpanel/scripts/removeacct username --force
--keepdns Retain the account's zone files from the DNS server when the script terminates the account (useful when migrating accounts between servers in a DNS cluster).
ex.
/usr/local/cpanel/scripts/removeacct username --keepdns
Keep in mind that account termination is final, and cannot be reversed without restoring a full backup of the orphan account. These above procedures are not intended to replace WHM Terminate an Account interface and should only be used as a temporary workaround when other methods are not available. Please use caution.