How to lock a particular directory in cPanel?

How to lock a particular directory in cPanel? [Important| Revised 2019]

When you add password protection to a directory, you provide a name for the directory that will appear in users’ web browsers when they are prompted for a username and password. Then you create users and passwords to specify who can access the directory. To access that directory one has to specify username and password. This is best way to protect any directory from being viewed to any user.

Steps to lock a particular directory in cPanel [Updated May 2019]

step::1 Login to your cPanel

step::2 Create any directory inside public_html(Just for testing purpose i have created “Myself” named Directory)

step::3 Right click on that Directory and click on Password Protect

How to lock a particular directory in cPanel| cheapest linux hosting provider
How to lock a particular directory in cPanel

step::4 Now Enter a name for the protected directory text box, type a name for the protected directory.

step::5 Click Save. Now click on “Go Back”

best linux hosting provider
How to lock a particular directory in cPanel
cheapest linux hosting provider
How to lock a particular directory in cPanel
  • Create User, type a username in the Username text box.
  • In the New Password text box, type the user’s password.
  • In the Confirm Password text box, retype the user’s password.
buy cheapest linux hosting from redserverhost
How to lock a particular directory in cPanel

step::6 Click on Save. Now you have finally locked your directory.

You can simply check it from outside as i am checking out my directory, it is asking for username and password

best linux hosting provider redserverhost
How to lock a particular directory in cPanel

Hope you have now understood how to lock access to any particular directory.

For more queries and suggestions feel free to write or you can also comment below.