The suspendacct Script

Valid for versions 96 through the latest version


Last modified: March 16, 2021

Overview

The /usr/local/cpanel/scripts/suspendacct script lets you to suspend a cPanel account from the command line. You can also use WHMs Manage Account Suspension interface (WHM » Home » Account Functions » Manage Account Suspension) to suspend an account.

For more information about the effects of account suspension, read our What Happens When You Suspend an Account documentation.

Run the script

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

/usr/local/cpanel/scripts/suspendacct [account] [options]

Options

Use the following options with this script:

Options
Description Example
account Required.
The cPanel account that you want to suspend.
Important:
You cannot suspend a reserved username (for example, root or nobody).
username
reason The reason for suspension, surrounded by quotes. The script adds the given reason to the accounts /var/cpanel/suspended/username file, where username is the accounts username. "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.
disallow
--child-ok Force the script to suspend a distributed cPanel account via a child node.
Warning:
You should always suspend accounts from the parent nodeOnly use this option in an emergency.
--child-ok
--force Force the script to suspend the account, even if it is a suspended account. --force
--leave-ftp-accts-enabled Whether to skip suspension of the accounts FTP accounts.
Warning:
Enabling this option may cause security issues. We strongly recommend that you do not use it.
--leave-ftp-accts-enabled
--help Display the help text for this script. --help

Example

The following example suspends the username account and skips suspension of the accounts FTP accounts:

/usr/local/cpanel/scripts/suspendacct username "Failure to pay monthly fee." --leave-ftp-accts-enabled

The scripts output will resemble the following:

1
2
3
4
5
6
7
Changing Shell to /bin/false...Done
Locking Password...Done
Suspending email account logins for example.com .... Done
Suspending mysql users
Suspending websites...
Suspending outgoing email....Done
username's account has been suspended
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The servers_queue Script

Valid for versions 82 through the latest version Last modified: June 21, 2021...

The auto-adjust-mysql-limits Script

Valid for versions 82 through the latest version Last modified: June 21, 2021...

The autossl_check Script

Valid for versions 82 through the latest version Last modified: May 13, 2020 Overview...

The backup Script

Valid for versions 82 through the latest version Last modified: May 13, 2020 Overview...

The backup_restore_manager Script

Valid for versions 82 through the latest version Last modified: July 28, 2022...