How to Password Protect A Directory

Directory privacy is crucial to the security of your online files. You can limit access to certain resources of your website by password protecting the directories they are in. cPanel has a utility called Directory Privacy that allows you to prohibit access to a directory unless you know the username and password. Here is how to use it:

  1. Select the Directory Privacy link from the Files section of cPanel. A list of the directories on your account will appear.

  2. Click the name of the directory you wish to limit access to. On the next page you will need to do a few steps. First, check the Password protect this directory check box. Then create a name that will appear in the login screen (Enter a name for the protected directory). Then create a username and a password that users can use to access this protected directory. Finally, click on the Save button to activate the protection.

Please note that you have to create a directory before you enable the password protection for it. Also, using one and the same directory for the purpose of password protection and FTP storage at the same time is not recommended.

It is also important to add that password-protecting your webroot (the public_html/ www directory) will lead to inability of your website to be displayed directly.


cPanel's official documentation on this particular task can be found at https://go.cpanel.net/DirectoryPrivacy.

As always if you have any questions on using this utility, please open up a support ticket via your client area. We will do our best to assist you.

  • 44 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

Managing Common cPanel Tasks Within The Client Area

We have upgraded our billing system with a new module call cPanel Extended. cPanel Extended...

How to change your cPanel/FTP password

The first thing you need to do is log into your client area at...

How to use the Email Disk Usage Tool

The Email Disk Usage tool is an exciting tool that was released in 2017. This utility allows you...

How to change the PHP Version for your website

PHP is a server-side scripting language that is used to develop some of the most popular web...

CPanel Backups

Due to slight variations in CPanel versions and included software, exact procedures may vary...