WHM Returning 401 errors due to Host Access Control

Brad Groux

Registered
Aug 27, 2010
4
0
51
Houston, TX
It seems I made a rookie mistake and screwed up my host access control list somehow from within WHM. I added three IP addresses with ALL/DENY in the HAC, and now I receive "HTTP error 401 You do not have permission to access this page" errors anytime I click on a link in the menu of WHM.

The IP addresses I added were in my stats as people trying to run PHPMyAdmin exploit scripts... and I know I didn't add myself because my router has an IPv6 IP. I've also tried connecting with my phone's internet sharing with the same results.

How can I clear the entries in HAC from the shell?

I obviously realize now I should be blocking IPs via iptables.

Thanks
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

Changes to the Host Access Control screeen are stored in the /etc/hosts.allow and /etc/hosts.deny files on your server.

Thank you.
 

zemon

Registered
Mar 5, 2014
1
0
51
cPanel Access Level
Website Owner
I have the same issue, I restricted all connections through SSH,WHM,Cpanel to my IP address but now my internet has been down and I can only access through a different IP address.

Should I just clear the files hosts.deny and hosts.allow?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
I have the same issue, I restricted all connections through SSH,WHM,Cpanel to my IP address but now my internet has been down and I can only access through a different IP address.

Should I just clear the files hosts.deny and hosts.allow?
If you have access to the /etc/hosts.allow file, yes, update it to reflect your new IP address.

Thank you.