How To Password Protect A Directory In cPanel
How To Password Protect A Directory In cPanel
This interface allows you to protect specific directories in your cPanel account’s files. After you enable this feature for a directory, when users attempt to view that directory via a website, the system prompts them to log in.
Note: This feature modifies htaccess and htpasswd configurations in order to restrict access to files on your websites. This feature does not protect directories that users access via FTP, SFTP, Web Disk, or other services, or when they access files locally.
Select a directory
To use this interface, select a directory to manage.
- To select a directory, click the desired directory’s name.
- To view and select subdirectories, click the parent directory’s folder icon. Then, click the desired subdirectory name.
Password protecting a directory
To password protect the selected directory, perform the following steps:
Select the Password protect this directory checkbox.
Enter a display label for the directory in the Enter a name for the protected directory text box.
Click Save. A confirmation message will appear. Click Go Back to return to the directory’s configuration.
Create User
To create an authorized user for the selected directory, perform the following steps:
Enter the desired username in the Username text box.
Enter and confirm the new password in the appropriate text boxes.
Click Save. A confirmation message will appear. Click Go Back to return to the directory’s configuration.