There can be times where you want to password protect certain folders. By doing so you can add an extra layer of protection to files you don’t want the general public to have access to. Adding passwords to directories can be done quite easily with cPanel’s Password Protect Directories. When you password protect a directory, cPanel will create a rule in your .htaccess file. This rule specifies that the folder is protected and the visitor will need to provide the proper log in credentials to view the files.
This tutorial will guide you on this topic in detail with images of each step. Watch the video tutorial about this setup on Familiarizing with cPanel – How to password protect a directory in cPanel?
- Log into cPanel
- Find the Password Protect Directories icon under the Security heading and click on it.
- Select the directory you’d like to navigate to in the pop up window. Click GO.
- Now, select the directory you wish to password protect. Click a folder name and it will be password protected. If you want to password protect a sub folder, click on the folder icon next to it’s name, then select your sub folder.
- Once you have selected a folder to password protect a screen will appear with settings you’ll need to configure. Check the Password protect this directory box. Give the directory a name and click Save.
- The directory is now protected, and requires a password to enter it via a browser. We must therefore create at least one user, and assign them a password to access the directory so click Go Back.
- Enter a username here.
- Then enter and confirm a password.
- Click Add authorized user.
- The protected directory now has one user who has access to it. Repeat this process for each additional user you want to grant access for. You can see the active user for this directory here, and can add or delete users from this page at any time.
How to password protect a directory in cPanel?
This is the end of the tutorial. You now know how to password protect directories, and assign users to them. Checkout other tools under the Security category in cPanel to learn about each of it in detail.