How do I password protect a directory in my control panel (cpanel)?Written by Brad Markle
Click here to watch a video tutorial
At times, you may find it best practice to password protect a folder on your account. This can add an extra layer of protection to files you don’t want the general public to have access to. Password protecting a directory can be easily accomplished using the option within cPanel.
Understanding how password protecting a directory works
It’s important to understand how password protection on a folder works. When you choose to password protect a directory in cPanel, cPanel creates a rule in your .htaccess file. This rule specifies that the folder is protected and the visitor will need to provide the proper username and password to log in and view the files.
Please keep in mind, when you grant access through password protection, you are not only granting access for that folder, but any subfolders located within it. Also, by password protecting a directory and gain access to any subfolders in that directory you must provide the login credentials to do so.
Steps to Password Protect a Directory
- Log into cPanel
- Find the icon under the "Security" heading and click on the "Password Protect Directories" icon
- Select the directory you'd like to navigate to in the pop up window.
- Now, select the directory you wish to password protect. Clicking a folder name will password protect that folder. If you want to password protect a subfolder, click on the folder icon next to it's name, then select your appropriate folder.
- Once you have selected a folder to password protect a screen will appear with settings you'll need to configure. When finished save the settings and "new" user you create.
- Now, when you visit the site in your web browser you'll be prompted with a login screen for that directory.
If you have further questions or need further assistance please feel free to contact our support department.