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

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

To engage with the ServInt Sales Team use the following chat icon. Normal sales hours are Monday-Friday 9am-5pm EST but feel free to leave a message and we will follow up as soon as possible.

Sales Chat



To engage with the ServInt Support Team you must be logged into our Customer Portal for identity verification and have a ticket opened about your request or there will only be limited support offered.

Support Chat

CLOSE