This article describes how to use cPanel to password-protect certain directories. Visitors must enter a username and password to view the contents of password-protected directories.
Adding password protection to a directory
When you add password protection to a directory, you specify the name of the directory that will be displayed in users’ web browsers when they are prompted for a username and password. Next, you need to create users and passwords, specifying who can access the directory.
Please follow these steps to add password protection to a directory:
- Log in to cPanel.
- Click Directory Privacy on the Tools page, in the Files section:
- Click the name of the directory that you want to protect.
- To open the folder you can click the folder icon next to a folder name.
-
Click Edit.
-
To protect this directory check box select the Password under Security Settings.
-
Type a name for the protected directory in the Enter a name for the protected directory text box.
-
Click Save.
-
Type a username in the Username text box under Create User.
-
Type the user’s password in the New Password text box.
-
Retype the user’s password in the Confirm Password text box.
You can click Password Generator and cPanel generates a random, strong password for you. -
Click Save and cPanel adds password protection to the directory.
It is possible to add multiple users to a password-protected directory.
Removing password protection from a directory
It is possible to remove password protection from a directory if you no longer want to password-protect it. To do this, you don’t need to delete the usernames and passwords you created for the directory. All usernames and passwords are retained when password protection is removed from the directory but becomes inactive. If you subsequently re-enable password protection for the directory, you can use the same usernames and passwords again.
Please follow these steps to remove password protection from a directory:
- Log in to cPanel.
- Click Directory Privacy on the Tools page, in the Files section:
- Click the name of the directory for which you want to remove password protection.
- Click Edit.
- Clear the Password to protect this directory check box under Security Settings.
- Click Save and cPanel removes password protection for the directory.
Looking for an outstanding cPanel-based web hosting provider? Try our web hosting packages with cPanel