cPanel WHM – Wipe cpHulk Lockouts

Posted by & filed under Firewalls, Security, Server Admin.

cPanel WHM’s cpHulk system manages iptables blocks against IP addresses that fail to authenticate repeatedly. While the settings are fairly lenient and shouldn’t result in legitimate users being blacklisted, occasionally it can happen. The following command will reset the blocklist completely. While this is akin to using a shotgun when a scalpel is required, the blocks are time based and any malicious addresses would get quickly re-blocked.

 

iptables -F cphulk && mysql -e "Delete from cphulkd.login_track;"

There is a method to remove specific addresses, but I do not have the commands handy at present, and if I remember correctly it entails connecting to the mysql console, running a query to find the IP in the block table and issuing a drop query.

Backing up a cPanel account via the console

Posted by & filed under Server Admin.

Backing up the account
– Log-in via SSH as Root user

– Run the pkgacct command to package the account into a tar file:

/scripts/pkgacct username

The account backup will be created in the current working directory.

Restoring the account
– Log-in via SSH as Root user

– Run the restorepkg command to restore the cpbackup archive. Make sure you are in the same directory as the backup file

/scripts/restorepkg username

If the account already exists, you may need for force the restore:

/scripts/restorepkg --force username

There are also options to specify the account’s IP address, etc.

Installing git on a cPanel server

Posted by & filed under Server Admin.

I needed to install git on a cPanel server recently. After adding the appropriate EPEL5 or EPEL6 repo (fedoraproject.org/wiki/EPEL), you should be able to simply do a:

yum install git

But yum kept reporting a unmet dependency — a Perl-git package — even though I verified the missing package is actually present in the EPEL repo. After a bit of digging, I found cPanel has set yum to exclude any packages with Perl in the name. Simple enough to fix, but aggravating:

vi /etc/yum.conf

Remove “Perl*” from the exclude line and save.

yum install git

Jump back into the yum.conf file and add the perl* exclusion back in so yum does not eat cPanel’s braiiiinnns….

Done!