It is often required to restrict access to certain important directories with classified data. To restrict access to these confidential directories/folders, cPanel provides a very user friendly option to setup a username and password based authorization so that only privileged users would access the data.

Here are the steps to password protect directories using cPanel.

  • Go to cPanel >> Files >> Directory Privacy.


  • Click on public_html or any other directory under which the directory to be protected with password is located.
  • Check the tick box Password protect this directory.
  • Enter the full path of the password protected directory, eg: if the directory is public_html/media/new, then enter media/new in the field Enter a name for the protected directory.
  • Click Save.


  • Enter the username and password.
  • Click Save.

Now, if you access the directory via a web browser, you can see a box popping up asking for authorization.


Just enter the username and password you specified earlier and click on ‘Log In’. This will give you access to the password protected directory.

If you need any assistance with this, just contact our 24/7 support team via LiveChat or Email.

Leave a Reply

Your email address will not be published. Required fields are marked *