Casbay Knowledge Base

Search our articles or browse by category below

Tips WHM/Cpanel: WHM Access Restriction for Certain IP

Last modified: October 1, 2022
You are here:
Estimated reading time: 1 min

Tips WHM/Cpanel: WHM Access Restriction for Certain IP

One of the common problems while managing WHM/CPanel based hosting is blacklist access into WHM/CPanel due to CPHulk plugins. CPHulk activated by default on WHM (if you choose Yes while initial setup) and serves as a blacklisted software just like Fail2ban or Denyhost to prevent logon services from spammers/crackers.

The problem is that CPHulk can’t often decide which access is normal and which aren’t. Consequently, due to so many failures, even our valid IP could be blacklisted or could not be logged in as root. Why? Because cracker will try to select a random password, and after a few logins attempt CPHulk will automatically reject root login.

Modify WHM Access Limit

In addition to closing the recommended port, there is easier way to anticipate this kind of problem, by modifying the WHM access limit/WHM login page access protection.

To do so, run the following procedure :

  1. Firstly, login to WHM login page, enter your user name and password.

  2. In the Security Center group menu, click Host Access Control menu.

  3. On the Daemon, select Whostmgrd daemon. It is a daemon application for WHM. We can also choose to protect SSH (SSHD) daemon or CPaneld daemon for CPanel.

  4. In the Access List, enter the IP or IP range that allows accessing. Write down the full subnet.

    For example, to network segment 122.201.98.70/29 means to enter the IP 122.201.98.64/255.255.255.248. Configure it as 122.201.98.64/29 will not work because WHM will only accept full network subnet. If you asked, why using 122.201.98.64/255.255.255.248 and not 122.201.98.70/255.255.255.248 instead, then you should take the IP subnet course.

  5. In the Action section select “Allow”.

  6. Then, do the same thing to another IP segment which will be allowed.

  7. At the bottom, Select Daemon = WhostmgrdAccess List = ALL and Action = Deny. Means that other than registered IP will not be allowed.

  8. Lastly, click the “Save Host Access List” when finished.

  9. Now you can perform WHM access from the allowed IP and from outside registered IP list.

For those who are accustomed to dealing with Linux servers, the above process basically does limit access by adding a rule in the file /etc/hosts.allow

We hope this article helped you to learn about WHM Access Restriction. For more articles, kindly visit our Knowledge Base.

Was this article helpful?
Dislike 0
Previous: cPanel Application Log Files Location
Next: HOW TO: Generate and Renew Let’s Encrypt SSL certificates in Plesk