Server Security

How can I limit access to certain directories on my server by requiring a password using cPanel/WHM?

Password protection is often used to protect a web directory if it contains data that should only be available to specified users. cPanel implements this control by using Apache’s .htaccess file. To set up a password for a folder:

  1. Log into cPanel for the account in question.
  2. Click Password Protect Directories in the Security section.

Note: For those using the “Paper Lantern” theme, replace step 2 with: Click Directory Privacy in the Files section.

  1. Select either the Web Root or Document Root directory and click Go.
  2. Select the folder you wish to password protect. You can also do this by going into File Manager and right-clicking on the appropriate folder.
  3. Follow the directions on the Password Protect Directory page to change the security settings for the folder and to create authorized users.

Photo by Marc Falardeau

Find out more about ServInt solutions

Starting at $25

  • The New York Times
  • The Hill
  • Bloomberg
  • The Seattle Times
  • Computer World
  • Ars Technica