How to protect a folder with username and password in cPanel?

You can lock a directory with a password by using the cPanel "Password Protected Directories" option.
1. Log into your cPanel account.
2. In the "Files" section, click on the "Directory Privacy" icon.


3. Click the icon to open a folder.
 

4. Click on the name of the directory you want to protect.


5. Under "Security Settings", check the box next to "Password protect this directory" and enter a name for the protected directory, e.g. "Password Protected Area" or any word\s of your choice. Then click on the "Save" button.


6. Now click on the "Go back" button.


7. Scroll down the page and under "Create User" fill in the username and password fields or use password generator option to generate a new random password. Then save username and password somewhere for future references. You will need them when you want to open your password protected directory. Click on the "Save" button.


Now, when you will try to open your password protected directory in your browser through the www.example.com/protectedfolder, your browser will prompt you to enter username and password you have entered on the step 7.


 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to ban any IP address via cPanel?

If someone is abusing your website and you want to block abuser's IP address from accessing your...

How to protect your website's images from an external website?

External websites can use <img/> tag to display an image from your website on other...

How to ban any IP address via .htaccess?

If someone is abusing your website and you want to block abuser's IP address from accessing your...

How to disable directory browsing using .htaccess?

For security reasons it is recommended to disable directory browsing of your website so no one...

How to protect your .htaccess file?

For security reasons it is recommended to protect your .htaccess file from unauthorized...