How to add password protection for a directory in cPanel

April 7, 2022 / cPanel & WHM

In this article, we have explained how to password-protect a directory in cPanel. Password-protected file sharing improves the security of your sensitive folders and data.

Let us follow the steps:

  1. Log in to the cPanel account.
  2. Select the “Files” section.
  3. Click on the “Directory Privacy” option under the files section.
    files>directory privacy
  4. You will enter a new interface that lists all the directories.
  5. Select the directory and click on the “Edit” button.
    directory privacy
  6. You will be directed to the “Directory Privacy” page.
  7. Select the “Password Protect this directory” check box.
  8. The name box will be activated if you click the password-protect check box.
  9. Enter the name of the directory to be protected.
  10. Finally, click on the “Save” button.
    privacy
  11. You will receive the final success message.
    directory privacy
  12. You can see the symbol of a lock after the directory has been protected.
    lock

Create a User for the Protected Directory
After enabling password protection, you must create a user who will be allowed to access the directory.

  1. Under Create User, enter a Username.
  2. Set a Password (or use the password generator).
  3. Click Save to create the user.
    create user

Important: Without creating a user, the directory will remain inaccessible.

In this way, you can add password protection to a directory in cPanel.

You can disable the directory listing to further increase the security and privacy of the directory. It protects sensitive files such as backups and configurations, ensuring that only authorised users can access them.

Wasn’t it useful? We hope that now you will be able to password-protect the directory in cPanel. Don’t forget to check our latest Web hosting plans.

Spread the love