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.