How to suspend Cpanel user through ssh / Cpanel shell command to suspend users

Friday, 5th August 2011

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
Locking Password...Locking password for user abuse_user.
passwd: Success
Suspending mysql users
warn [suspendmysqlusers] abuse_user has no databases.
Notification => 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/
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.

Share this on:

Download PDFDownload PDF

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

One Response to “How to suspend Cpanel user through ssh / Cpanel shell command to suspend users”

  1. admin says:
    Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
    Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

    Another important thing on building new Linux servers is to always select the correct my.cnf as a basis according to the scale of mySQL server and the server hardware:

    A good place to look on for choosing the correct type of initial configuration in accordance to the server hardware and expected load is:

    hipo@noah:~/Desktop$ ls -al /usr/share/doc/mysql-server-5.1/examples/my-*
    -rw-r–r– 1 root root 2061 Feb 8 14:16 /usr/share/doc/mysql-server-5.1/examples/my-huge.cnf.gz
    -rw-r–r– 1 root root 7817 Feb 8 14:16 /usr/share/doc/mysql-server-5.1/examples/my-innodb-heavy-4G.cnf.gz
    -rw-r–r– 1 root root 2044 Feb 8 14:16 /usr/share/doc/mysql-server-5.1/examples/my-large.cnf.gz
    -rw-r–r– 1 root root 2063 Feb 8 14:16 /usr/share/doc/mysql-server-5.1/examples/my-medium.cnf.gz
    -rw-r–r– 1 root root 2445 Feb 8 14:16 /usr/share/doc/mysql-server-5.1/examples/my-small.cnf

    If for example the mysql server will be a very heavily loaded server the my-large.cnf has to be used the name of the file is self explanatory so just pick the file you need extract the .gz and ovewrite the default my.cnf from install.

    View CommentView Comment

Leave a Reply

CommentLuv badge