Block access to whm.domain.com and cpanel.domain.com
Hi guys,
How do I block access to whm.domain.com
and cpanel.domain.com
while keeping webmail.domain.com
accessible. Additionally, DNS records for autoconfig
and autodiscover
should remain functional for mail clients.
cPanel's system-level subdomain handling often overrides manual configurations, So my .htaccess blocking isn't working. Looking for the most reliable way to block cpanel
and whm
subdomains without affecting other services.
-
/scripts/proxydomains --subdomain=whm remove
and
/scripts/proxydomains --subdomain=cpanel remove
1 -
Thanks mate
0 -
Is there a way to block access to WHM subdomain AND port 2087 except for a certain domain.
I have several domains on my cPanel and they can all access WHM via 2087 if they had the root credentials. I have set up a random domain such as kabcbcldnbeinsbxhdj.com and I want this to be the only domain to be able to access port 2087 or WHM as a subdomain.
0 -
Anyone can access WHM using any of the domains in that server or the server's IP address.
"if they had the root credentials"?
It like asking "how to prevent people from coming to my home if they have my keys?"
I'd suggest to use 2FA:
https://docs.cpanel.net/cpanel/security/two-factor-authentication-for-cpanel/0 -
Ok. You can tell I’m new.
Is there a way of only allowing access to WHM or 2086/2087 from only my ip address while blocking it from absolutely any other ip address?
0 -
I tried that. I set deny to ALL and accept to my Macs IP address but I could still access WHM on my mobile that was using mobile data.
0 -
Did you ensure the deny rule was placed after the allow rules?
0 -
Yes, exactly as it shows in the cpanel documentation
0 -
This is one of the core functions of cPanel that "just works" so if that isn't working as expected it would be best to create a ticket so this can be investigated.
0 -
I've just restarted my server and it does appear to be blocking access via port 2087. That's part one sorted.
How can I block access to whm.mydomain.com from all IP addresses except mine?0 -
There isn't going to be a way to do that portion besides removing the proxy domain.
0 -
Could I go to my cpanel and create the sub domain whm.mydomain.com and redirect it my domain.com?
0 -
You could do that after the proxy domains were removed, but if you try it before it will conflict with those proxy service domains.
0
Please sign in to leave a comment.
Comments
14 comments