Knowledge Base

How to Password Protect a Specific Folder in cPanel

How to Password Protect a Specific Folder in cPanel


1- Enable Directory Password Protection

   1. Log in to your cPanel account.

   2. In the Files section, click on Directory Privacy.

   

   3. A list of folders will appear. Locate and click Edit next to the folder you want to protect.

   

   4. Check the box Password protect this directory.

   5. Click Save to apply the protection.


2- Create a User for the Protected Directory

After enabling password protection, you need to create a user who can log in:

  1. Click the Back button to return to the updated Directory Privacy page.
  2. Fill in the fields:
    • Username: choose a login name.
    • New Password: set a secure password (you can use the Password Generator).
    • Confirm Password: re-enter the password.
  3. Click Save to create the user.

Only users with these credentials will be able to access the protected folder via browser.


3- Adjust Folder Permissions

   1. In cPanel, go to File Manager.

   2. Right-click on the protected directory and select Change Permissions.

   3. Set the permissions to: 744



  • This means:
  • Owner: read, write, execute
  • Group: read only
  • Public: read only

 

Please rate this article to help us improve our Knowledge Base.

0 0