Search The Hostwinds Guides Knowledge Base

How To Password Protect Folders In cPanel

There may come a time when you have a directory that you want only certain people to access. This can be done through a variety of ways, such as through the .htaccess file. Or other methods depending on your control panel. This guide will be describing how this can be done through your cPanel interface.

 

Where To Find The Option In cPanel’s File Manager

 

The easiest way to locate the option to password protect your files or folders, is within cPanel’s File Manager.

  1. Log into your cPanel.
  2. After you are logged in, navigate to the File Manager icon within the cPanel interface. By default, this should be located near the top of the page.
     
    Close up view of where to locate the file manager
  3.  

  4. Once in the File Manager you’ll want to navigate to the folder that you are wanting to password protect. Once found, you can Right Click on the file and choose Password Protect from the options.
     
    Where you can find the option to Password Protect a file or folder in cPanel's File manager
  5.  

  6. After clicking that option, you’ll be brought to the Directory Privacy page, from which you can proceed with the steps below.

 

Where To Find The Option Within cPanel’s Interface

 

Another way to access the Directory Privacy page would be from the Directory Privacy icon within cPanel. This will be located within the Files section, which by default, should be near the top of your cPanel.
 
Where to find the Directory Privacy icon within cPanel
 
Clicking on that Icon will take you to the necessary page to setup folder permissions for a directory. Once there, you can continue with the instructions below on setting up a password protected folder.

 

Password Protecting a Folder In cPanel

 

  1. If you had not selected a directory from within the File Manager, you would be able to select one here. You can enter inside of folders by pressing the folder icon on the left of the folder name. Clicking the folder name itself will select it for password protecting.
     
    What is shown in Directory privacy if no directory is specified
  2.  

  3. Once you have selected the folder that you’ll be password protecting, you’ll want to add it as a password protected directory. And add a user to the directory for access.
     
    cPanel Directory Privacy options that are available after directory is selected.
     

    1. Make sure that the directory you had selected is named here. That way you don’t block access to the wrong directory.
    2. Once you confirm the name of the folder, you’ll want to click this checkbox so that Password protect will be enabled for the folder above.
    3. Here you’ll enter a user-friendly name that can be used to identify your folder. Such as “testing only” or “private access”.
    4. Click the Save button to save this in cPanel. By default, now it will block all access (until a new user is created below)
    5. Now for creating the user that will have access. Put the username that you want them to login with. (You can add more users to this folder later on as well, by repeating these steps)
    6. Input a password for the user to login with for the directory.
    7. Confirm the password to be used, by reentering the password here.
    8. Click the Save button which will allow that user to login to access that directory.
  4.  

  5. After that has been done, whenever anyone attempts to access the folder from their browser, they’ll be prompted for a username and password. If correct, it’ll allow them access to the files and site content you have there.

 

If you should have any questions or would like assistance, do feel free to contact us through Live Chat, on our Phones, or by submitting a ticket with our Technical Support team.

 

Related Articles