Knowledgebase

How to Password Protect a Directory in cPanel

Print
167

To protect a folder with a password through cPanel control panel, follow these steps:

Step One: Access Directory Protection Tool

  1. Log into your cPanel control panel
  2. Navigate to the "Directory Privacy" section by clicking on its icon

Directory Privacy icon in cPanel control panel

Step Two: Locate the Directory

  1. Go to the website folder public_html to select the directory that will be protected

Navigating to public_html folder

Step Three: Choose Directory to Protect

  1. Select the directory you want to protect (in this example we'll choose the cgi-bin folder)

Selecting the directory to protect

Step Four: Enable Password Protection

  1. From the "Security Settings" section, enable the option next to "Password protect this directory" to protect the folder with a password

Enabling directory password protection

Note: You can also add a name for the protected directory in the "Name this protected directory" field to display to visitors when requesting the password.

Step Five: Create New User

  1. In the "Create User" section, create a username and set a password for it
  2. Enter your desired username in the "Username" field
  3. Enter the password in the "Password" field
  4. Click "Save" to complete the directory protection

Creating a new user for accessing the protected directory

Managing Users and Permissions

After creating the protection, you can:

  • Add new users: To grant access to other people
  • Modify passwords: To update security credentials
  • Delete users: To revoke access permissions
  • Remove protection: To remove password protection from the directory
Warning: Save the user credentials (username and password) in a secure location. You'll need them to access the protected directory later.
Security Tip: Use a strong password containing uppercase and lowercase letters, numbers, and symbols to ensure better security for the protected directory.
Was this answer helpful?