How to Protect a Directory with a Password

You can password protect directories (folders) via the cPanel, protecting all the files within the password-protected folders.

Note: At this time, the cPanel can only protect directories, not individual files. Any file that needs protection can be placed in a protected directory. This also does not protect the directories that can be accessed locally or through FTP, SFTP, or Web Disk.

To password-protect a directory:

  1. Log in to your cPanel.
  2. Look for the Files section, then click on the Directory Privacy icon.HostGator - cPanel - Directory Privacy
  3. Locate the name of the directory you wish to password protect.HostGator - cPanel - Directory Privacy - Choose Directory
  4. Click on your directory’s Edit button.
  5. Put a checkmark on Password protect this directory.HostGator - cPanel - Directory Privacy - Enter a Name
  6. Enter a name for the selected directory. It is important to note that this serves as the label of that directory. It does not change the directory’s actual name.cPanel - Directory Privacy - Enter Name
  7. Click on the Save button.
  8. A confirmation page will appear. Click Go Back.HostGator - cPanel - Directory Privacy - Confirmation Prompt
  9. You will then need to create a User that can have access to this directory.
  10. Fill in the UsernameNew Password, and Confirm Password boxes. You can utilize the Password Generator button to generate a strong password.HostGator - cPanel - Create User - Fill out Information
  11. Click the Save button.

Was this article helpful?

Related Articles