How to Password Protect a Directory in cPanel

Sometimes it is userful to hide files within a directory (folder) and only give access to those files to people who have the proper password.

For example, you may want to only allow authorized people to view or download certain files. Or you may have setup a development version of a website that is not ready for the public, so you password protect it so only the developers can see it.

cPanel has implemented a simply way to password protect directories, that works independently from any scripts or software you might have installed. 

Password Protecting the Files in a Directory

Video Tutorial

Step 1: Specify Which Directory to Protect

First you setup the directory that you want to protect.

  1. Log into cPanel.
  2. Click on Directory Privacy in the Files section.
  3. Select the directory you want to password protect by clicking its name.
  4. Check the box next to Password protect this directory.
  5. Enter a name for the protected directory.
  6. Click the Save button.

Step 2: Setup Users Who are Authorized Access

Next, you setup the password and authorized users. You can setup one or more.

  1. Navigate to the Create User section on the Directory Privacy page.
  2. Enter a Username.
  3. Enter a new Password twice.
    • Use the Password Generator for a more secure password.
  4. Click on the Save button.

Repeat the process if you want additional users.

About the Author

WisTex's picture
Scott M. Stolz

Recommended Content