How to suspend Cpanel user through ssh / Cpanel
shell command to suspend users
One of the servers running
Cpanel has been suspended today
and the Data Center decided to completely bring down our server and
gave us access to it only through
rescue mode running linux
livecd.
Thus I had no way to access the
Cpanel web interface to
suspend the "hacker" who by the way was running a number of
instances of this old Romanian script kiddies brute force ssh
scanner called
sshscan .
Thanksfully Cpanel is equipped with a number of handy scripts for
emergency situations in
/scripts directory. These shell
management scripts are awesome for situations like this one, where
no web access is not avaiable.
To suspend the abuser / (abusive user ) I had to issue the
command:
root@rescue [/]# /scripts/suspendacct abuse_user
Changing Shell to /bin/false...chsh: Unknown user context is not
authorized to change the shell of abuse_user
Done
Locking Password...Locking password for user abuse_user.
passwd: Success
Done
Suspending mysql users
warn [suspendmysqlusers] abuse_user has no databases.
Notification => reports@santrex.net via EMAIL [level =>
3]
Account previously suspended (password was locked).
/bin/df: `/proc/sys/fs/binfmt_misc': No such file or
directory
Using Universal Quota Support (quota=0)
Suspended document root /home/abuse_user/public_html
Suspended document root
/home/abuse_user/public_html/updateverificationonline.com
Using Universal Quota Support (quota=0)
Updating ftp passwords for abuse_user
Ftp password files updated.
Ftp vhost passwords synced
abuse_user's account has been suspended
That's all now the user is suspended, so hopefully the
DC
will bring the server online in few minutes.