How to Suspend/Unsuspend All cPanel Accounts

Suspending or unsuspending all cPanel accounts in WHM can be accomplished efficiently through the command line interface (CLI). This tutorial will guide you through the steps required to perform these actions.

Step 1: Log in to WHM via Root Access

1. Open your web browser and navigate to your WHM login page.

2. Enter your root username and password to log in.

Step 2: Access the Terminal in WHM

1. Once logged in, look for the "Terminal" option in the WHM sidebar under the "Server Configuration" or "Server Status" section.

2. Click on "Terminal" to open the command line interface within WHM.

Step 3: Suspend All cPanel Accounts

To suspend all cPanel accounts, you will use the following command:

ls /var/cpanel/users | xargs -n1 /scripts/suspendacct

Explanation:

- `ls /var/cpanel/users`: Lists all the cPanel user accounts.

- `xargs -n1 /scripts/suspendacct`: Feeds each username to the `suspendacct` script, which suspends the account.

Step 4: Unsuspend All cPanel Accounts

To unsuspend all cPanel accounts, use the following command:

/bin/ls -A /var/cpanel/users | xargs -n1 /scripts/unsuspendacct

Explanation:

- `/bin/ls -A /var/cpanel/users`: Lists all the cPanel user accounts, including hidden files.

- `xargs -n1 /scripts/unsuspendacct`: Feeds each username to the `unsuspendacct` script, which unsuspends the account.

Complete Example

Here’s how you can run these commands step-by-step in the terminal:

1. Suspend All Accounts:

    ls /var/cpanel/users | xargs -n1 /scripts/suspendacct

2. Unsuspend All Accounts:

    /bin/ls -A /var/cpanel/users | xargs -n1 /scripts/unsuspendacct

Conclusion

By following these steps, you can easily suspend or unsuspend all cPanel accounts on your WHM server. Make sure to perform these actions with caution, as they will affect all user accounts on the server.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...

How to Secure a cPanel/WHM Web Server

Here are a few basic steps that you should keep in mind for keeping a server secure. 1) Strong...