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.
