Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htaccess to restrict Cpanel/WHM access

Discussion in 'Security' started by bwwt, Jan 10, 2004.

  1. bwwt

    bwwt Member

    Aug 13, 2003
    Likes Received:
    Trophy Points:

    After having my server hacked last week or so, I;ve been paranoid when it comes to closing all possible access points to the server.

    Anyone know how to setup a .htaccess file so that only certain IPs or subnets are allowed to access the panels?

  2. Sunjester

    Sunjester Registered

    Dec 17, 2010
    Likes Received:
    Trophy Points:
    any ideas ?
  3. cPanelJared

    cPanelJared Technical Analyst

    Feb 25, 2010
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This thread is almost seven (7) years old, so it is unlikely that the original poster still needs help with this question, but there is no need to create a .htaccess file to restrict access to the WebHost Manager or cPanel. Instead, you can use Main >> Security Center >> Host Access Control in the WebHost Manager.

    cpsrvd is the daemon that provides access to cPanel and the WHM, and webmaild is the daemon that provides access to Webmail, so you can use these settings to restrict access to certain portions of the interface, as well as to SSH.

    Please use caution with this configuration. If you access the Internet through a service that uses dynamic IP addresses, your IP address could change without warning and leave you without access to your server. It is best to allow access to more than one IP address or range of IP addresses, to leave you at least one other option to access the server should your normal workstation's IP address change.

    You may find the following section in our documentation to be helpful:

    Host Access Control
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice