PrackHost : Hosting Premium Web LiteSpeed

To protect Folder with Password

How to protect a folder with password in cPanel

In this tutorial we are going to learn to protect a directory of our Web through file .htaccess. If we want to protect a directory of our Web so that we only accede, this is the best solution.

An additional measurement of security, would be for example to protect the access to our administration of Joomla! with this method, that in addition is a recommendation of the same equipment that develops this CMS.

So we are going to develop this example on the basis of the previous premise.

1. To accede to the section from cPanel

In the first place we accede to ours cPanel and we sail to the section Archives > Privacy of Directory.

€œSelection of Directory€ will be opened to an emergent window and we punctured on the radio button €œRoot of Web (public_html/www)€ in addition to activating the option €œTo show hidden files (dotfiles) €œ.

We accede the corresponding option from cPanel

2. To choose the Directory To protect

We choose the folder to protect

In the following screen, we will immediately see all the folders that compose our Web in Joomla and among them the /administrator folder that we are going to protect.

Immediately, we make click on this folder that will take us to a new screen.

3. To protect Folder with Password

Now, in €œConfiguration of Security€ we activated the option €œTo protect this directory with password€ and in €œIntroducing a domain for the protected directory€ we put a name anyone (this name is simply the title that will appear in the emergent window, reason why we could use a text of the type €œDeprived Access €œ, €œAccess nonAllowed €œ, etc.) and punctured in the button €œTo keep €œ.

The system will indicate a confirmation message to us: €œWithout errors: The permissions of access for €œthe /home/xxxxxxxx/public_html/administrator€ user have settled down. €; we puncture in the button €œTo return€ that it will take the same screen back from to us.

To protect folder with password

4. We create Acceso

Next, we created the user and password. Immediately, we introduce the name of user of our election and preferably used the €œGenerator of passwords€ to choose a high security password.

Finally, we make click in the button €œKeep€ and in the following screen the system confirms the changes to us and we punctured in the button €œTo return€.

We will see that in the called section €œUsuary Authorized€, he will appear our user that we finished creating.

This user with his data of access will be the unique one that will be able to accede to this directory.

If we want to create more users to accede to the same folder, we can do it without you limit.

To create users who have access to the protected folder

5. Verification

In order to finalize, we verified that when keying in a navigator the URL of access to admin of Joomla opens an emergent window that will request the user and password to accede to our protected directory.

IMPORTANT: You must have well-taken care of because if you introduce bad the data in this emergent window several times, the Firewall of the Servant will block your IP as safety measure, since it will think that it is an attack from a third party to your surroundings Web.

If this happens, you will have to accede to the zone of clients in PrackHost to unblock it.

We introduce our data of user to be able to enter the folder protected with password

Published in ,
Transformation for PrackHost


Hosting specialized in Joomla! , Wordpress, Prestashop and Moodle. Services of hosting in the cloud. Dedicated servers VPS and.