Setting Up Directory Privacy with cPanel

cPanel tutorials & how to guides
Finding your way around, your cPanel hosting account

Protecting specific directories

Updated: January 19, 2023
By: RSH Web Editorial Staff

Contact Us

cPanel Version 108.0.15  -  Theme Version Jupiter

cPanel Tutorials Privacy

Files > Directory Privacy

Password Protected
This article describes how to protect specific directories with a password. Visitors to password protected directories must enter a username and password to view the contents.


This feature allows you to protect specific directories in your cPanel hosting account files.

After you enable this feature for a directory, when users attempt to see the directory the system will ask for proper login credentials

This feature modifies htaccess and htpasswd configurations in order to restrict access to files on your websites.
This feature does not protect Directories that users access via FTP, SFTP, Web Disk, or other services, or when they access files locally.

Select a directory

To use this interface, select a directory to manage.
• To select a directory, click the desired directory’s name.
• To view and select subdirectories, click the parent directory’s name. Then, click the desired subdirectory name.
• To configure the security settings for a directory or subdirectory, click Edit under the Actions column.


A protected directory’s subdirectories inherit their parent directory’s password protection.
The lock icon indicates that Directory Privacy configurations already exist for that directory.

Security Settings

You must perform these steps and click Save in order to enable this feature.

To password protect the selected directory, perform the following steps:

Select the Password protect this directory checkbox.

To remove password protection from a directory, de-select the Password protect this directory checkbox. Then, click Save.

Enter a display label for the directory in the Enter a name for the protected directory text box.

This name only functions as a label for the directory. Do not confuse it with the directory’s actual name.

Click Save. A confirmation message will appear. Click Go Back to return to the directory’s configuration.

After you complete this process, you must create a user that can access this directory.

Create User

To create a user for a directory, the directory must have correct directory permissions. If you cannot create a user, change the directory’s permissions to 0700 in cPanel’s File Manager interface
cPanel » Home » Files » File Manager

To create an authorized user for the selected directory, perform the following steps:

1) Enter the desired username in the Username text box.
2) Enter and confirm the new password in the appropriate text boxes.

The system evaluates the password that you enter on a scale of 100 points. 0 indicates a weak password, while 100 indicates a very secure password.
Some web hosts require a minimum password strength. A green password Strength meter indicates that the password is equal to or greater than the required password strength.
Click Password Generator to generate a strong password. For more information, read our Password & Security documentation.

3) Click Save. A confirmation message will appear. Click Go Back to return to the directory’s configuration.

To change an existing user’s password, enter the user’s information and the new desired password. Then, click Save.

Authorized Users

The Authorized Users menu lists the directory’s existing authorized users.
To delete a user, select that user and click Delete User. A confirmation message will appear.
Click Go Back to return to the directory’s configuration.

Related cPanel Tutorials and How To Guides
cPanel manage every element of your web hosting account

Tweet  Share  Pin  Email

We welcome your comments, questions, corrections and additional information relating to this article. Please be aware that off-topic comments will be deleted.
If you need specific help with your account, feel free to contact us anytime
Thank you

More Articles Of Interest

RSH Web Services with a proven track record of providing excellent, customer-focused and reliable web hosting services. We are committed to providing our customers the best Internet service possible. Our commitment to customer satisfaction has made us one of the most trusted hosting providers in the industry