Password Protecting Directories in cPanel
Password protection for directories allows you to restrict access to specific areas of your website, requiring users to enter a username and password before accessing the content. This feature is useful for safeguarding sensitive information or private areas of your website.
Step 1: Login to cPanel
Step 2: Locate the Directory Privacy Option
- In the cPanel dashboard, scroll down to the Files section.
- Click on Directory Privacy (this may also be labeled as Password Protect Directories).
Step 3: Select the Directory to Protect
- You will see a list of directories on your server.
- Navigate through the folder structure to find the directory you want to protect.
- Click on the directory name.
Step 4: Enable Password Protection
- Once you select the directory, you will see Edit label click on it
- then you will see an option labeled "Password protect this directory."
- Check the box next to this option.
- Enter a name for the protected directory in the "Protected Directory" field. This is typically a brief description to inform users of the protection (e.g., "Private Area").
Step 5: Create a Username and Password
- Scroll down to the "Add a New User" section.
- In the Username field, enter a username that users will use to access the directory.
- In the Password field, enter a strong password. It’s recommended to use a combination of letters, numbers, and special characters.
- Confirm the password by re-entering it in the "Password (again)" field.
- Click the Add or Modify Authorized User button to save the new user credentials.
Step 6: Review and Save Settings
- After adding the user, you will see a confirmation message indicating the user has been added.
- You can add more users by repeating Step 5 if needed.
- Once you are finished, you can go back to the main Directory Privacy page to review the protected directory settings.
Step 7: Test Password Protection
- Open a new browser tab or window.
- Navigate to the protected directory (e.g.,
https://yourdomain.com/protected-directory
). - You should be prompted to enter the username and password. Enter the credentials you created in Step 5.
- If successful, you will gain access to the directory. If not, ensure you are entering the correct credentials.