The suspendacct Script

Valid for versions 88 through the latest version

Version:

88


Last modified: May 13, 2020

Overview

The /usr/local/cpanel/scripts/suspendacct script allows you to suspend an account from the command line.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/scripts/suspendacct user ["reason"] [disallow] [--help]

Options

Use the following options with this script:

Options Description Example
user The account that you wish to suspend.
Important:
You cannot suspend a reserved username (for example, root or nobody.)
cpaneluser
reason The reason for suspension, surrounded by quotes. /usr/local/cpanel/scripts/suspendacct cpaneluser "Failure to pay monthly fee."
disallow Whether to allow only the root user to unsuspend the account.
Important:
You must include the reason option if you wish to use the disallow option.
/usr/local/cpanel/scripts/suspendacct cpaneluser "failure to pay monthly fee." disallow
--leave-ftp-accts-enabled Whether to skip suspension of the account’s FTP accounts. /usr/local/cpanel/scripts/suspendacct cpaneluser --leave-ftp-accts-enabled
--help Displays the help text for this script. /usr/local/cpanel/scripts/suspendacct cpaneluser --help

Success and failure

If the function does not succeed because you entered a user that does not exist on the server, you will receive the following error message:

Invalid user

If the function succeeds, you will receive confirmation from the command line. The output will resemble the following text:

1
2
3
4
5
6
7
8
Changing Shell to /bin/false...Done
Locking Password...Done
Suspending email account logins for example.com .... Done
Suspending mysql users
Suspending websites...
Suspending FTP accounts...
Suspending outgoing email....Done
example's account has been suspended

Additional Documentation