Back to knowledgebase

How to Password Protect a Directory in cPanel

Directory Privacy screen in cPanel

Select the Directory

  1. Go to Files > Directory Privacy.
  2. Open the folder list.
  3. Click the folder name to view its subfolders.
Directory Privacy folder list opened to public_html
  1. Click Edit next to the folder you want to protect.

Turn on Password Protection

  1. Tick Password protect this directory.
  2. Enter a name for the protected area.
  3. Click Save.
  4. Click Go Back.

Create a User

  1. Enter a username.
  2. Enter and confirm a password.
  3. Click Save.
  4. Give the username and password to anyone who needs access.

Remove Password Protection

  1. Go to Files > Directory Privacy.
  2. Click Edit next to the protected folder.
  3. Untick Password protect this directory.
  4. Click Save.

Notes

  • Password protection applies to website visitors, not FTP users.
  • Subfolders may inherit protection from the folder above them.
  • Keep a note of any users you create for protected directories.