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

  1. Sign in to cPanel and open Files > Directory Privacy.
  2. Browse to the directory you want to protect. Click a folder name to browse inside it, or Edit to configure its protection.
  3. Select Password protect this directory.
  4. Enter a name for the protected directory. This is a label for the login prompt; it does not rename the folder.
  5. Click Save, then return to the directory’s settings.
  6. 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.