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:
- Select the Directory Privacy link from the Files section of cPanel. A list of the directories on your account will appear.
- 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.