Password protection restricts access to a selected website directory through a web browser. In cPanel, Directory Privacy provides this protection by requiring a username and password.
This procedure does not change file-system permissions for all directories. Those permissions are managed separately in File Manager.
Protect a directory
- Sign in to cPanel and open Files > Directory Privacy.
- Browse to the directory you want to protect. Click a folder name to browse inside it, or Edit to configure its protection.
- Select Password protect this directory.
- Enter a name for the protected directory. This is a label for the login prompt; it does not rename the folder.
- Click Save, then return to the directory’s settings.
- Under Create User, enter a username and password for an authorised visitor, then save the user.
Test the protection
Open a page in the directory in a private browser window and confirm that it asks for credentials. Test the authorised user’s login.
Info
Protection also applies to subdirectories. It restricts web access, not access through FTP, SSH or the hosting account’s file manager.