|
|||
|
Hello, I currently have a server with over 1000 cPanel accounts on it and I wish to terminate all of them if possible. I tried using the Terminate Multiple Accounts option in WHM but haven't had any luck (it times out when I try to do more than 20 accounts or so) and it freezes my browser for a few minutes when clicking a handful of checkboxes. Is there an easy method to terminate all of the accounts without doing a fresh install?
Last edited by kujoez; 07-06-2009 at 07:58 PM. Reason: Solved. |
|
||||
|
From the shell, /scripts/killacct (username)
The following could do some pretty nasty damage to a server but fortunately it must be executed as root to actually work but even still I am a little leary to post this below but since you asked, a small script to kill all accounts on the server at once and bypass the normal approval prompting: DO NOT EXECUTE THIS SCRIPT IF YOU DO NOT WANT TO WIPE THE ENTIRE SERVER CLEAN OF CPANEL ACCOUNTS AND YOU ARE ADVISED TO FIRST MAKE GOOD BACKUPS! Code:
#!/bin/bash
IFS="$"
ls /var/cpanel/users | while read KUSER; do
echo 'y' | /scripts/killacct ${KUSER}
done
some accounts may take longer than others to delete and may not necessarily be hung but just regular processing deleting large accounts. That said, you stand a much better chance of things working from the shell than from the WHM interface when talking about such a large task as deleting 1000 accounts at once.
__________________
My Server Expert: Server support, security, and management! Last edited by Spiral; 07-06-2009 at 02:20 PM. |
|
||||
|
Quote:
old servers after migrations so that should take care of it for you. Basically just reads in the list of cpanel accounts from the system and executes a killacct against each login name ... simple as that! Nice thing is if for some odd reason the wipe process hangs anywhere, you'll pickup where you left off when you start the script again and don't have to redo any previous account deletions because once an account is deleted, they will no longer be read as a valid cpanel login the next time the script is executed.
__________________
My Server Expert: Server support, security, and management! Last edited by Spiral; 07-06-2009 at 02:33 PM. |
![]() |
| Tags |
| terminate |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why is so easy to terminate accounts? | Kent Brockman | cPanel and WHM Discussions | 5 | 04-13-2008 10:57 AM |
| Multiple Terminate accounts | hosteurolive | cPanel and WHM Discussions | 1 | 03-15-2007 08:20 AM |
| How to mass terminate accounts?? | Juliet | cPanel and WHM Discussions | 6 | 08-21-2005 05:43 PM |
| Terminate Accounts Function | BobbyDouglas | cPanel and WHM Discussions | 6 | 01-30-2005 07:20 PM |
| Mass Terminate Accounts | sodapopinski | cPanel and WHM Discussions | 6 | 02-24-2003 01:45 AM |