Wesbytes Knowledge Base

Search our articles or browse by category below

Tips WHM/Cpanel: WHM Access Restriction for Certain IP

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

Blacklist access into WHM/CPanel caused by CPHulk plugins is one of the frequent issues when administering WHM/CPanel-based hosting. If you select Yes during initial setup, CPHulk is activated by default on WHM and functions as a blacklisted programme, similar to Fail2ban or Denyhost, to stop spammers and crackers from using logon services.

The issue is that CPHulk frequently is unable to distinguish between normal and abnormal access. As a result of so many failures, even our legitimate IP could be banned or prevented from logging in as root. Why? Because the cracker will attempt to choose a random password, CPHulk will automatically refuse root login after a few login attempts.

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

Was this article helpful?
Dislike 0
Views: 6