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.
Index of this article
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) .
2. To choose the Directory 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.
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.
In order to finalize, we verified that when keying in a navigator the URL of access to admin of Joomla http://www.mi-dominio.com/administrator 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.