How do I password protect directories?

In the case that you want added security to your website such as administrator logins, or perhaps you don't want anyone else to access a folder that is in development, you may want to use password protected directories in cPanel.

To password protect a directory:


1. Login to cPanel

2. Click on "Password Protect Directories" under the Security section in cPanel:

3. Accept the pop-up for the directory you want to open:

4.  Navigate to the appropriate folder by clicking the folder icon on the left, then click on the folder name that you wish to password protect:

5. Add a user with a password under the "Create User" area. Click "Add/modify authorized user":

6. Click back to be brought back to the previous screen:

7. Check the box "Password protect this directory", and set what will be displayed on the login pop-up. Click Save:

8. Navigate to the directory in your browser, making sure that the password protect works.

Please note that any .htaccess modifications from now on must be monitored closely. Adding a password protected directory adds code to your .htaccess file, so removing or updating this .htaccess file could potentitally remove the protection.

Reviewed 12/28/16

  • Email, SSL
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I access the Raw Logs from cPanel?

cPanel comes with a number of log analyzing programs such as AWStats and Webalyzer, but suppose...

I deleted a file in FileManager, how can I restore it?

If you have deleted a file in the File Manager from inside your cPanel all is not lost.  Just be...

Can't access cpanel - How to open a port in Windows Live OneCare - delete

This article is marked for deletion as it is relevant only to add-on software for Windows Vista...

How often are statistics generated?

It looks like the stats generate at different times. What time do they usually run? All of the...

How do I execute a PHP file from CRON?

  In order to execute a PHP file from the CRON, you need to add a line to your PHP script. It...