How to install authorization

How to install authorization

Many websites in a world wide web provide a public access to information which is contained on them. Anyone can view public pages of resources. However happens so that to some sections of websites it is necessary to provide limited access.

Instruction

1. Be connected to the ssh server. If you have a console client, then make a team in the ssh console @. For example, the command can look so ssh This email address is being protected from spambots. You need JavaScript enabled to view it.. Enter the password after request from the account. You can use alternative client programs under windows. For example, one of such programs is called putty.

2. Pass on the server into the root directory which is not available from web. In it, as a rule, there is a subdirectory under the name public_html in which all contents of a resource available for viewing through network of the Internet are placed. Use the CD command. If you do not remember a full path to the folder, then for receiving contents of the directory use the ls command and make phased transitions.

3. In the current directory create the file of passwords. Execute the htpasswd command - with. "" -"" is a correct file name. For authorization data will be placed in it. "" -"" is an identifier of users. They will have access to the section of a resource. The command looks so htpasswd - with .pwd User1. After you enter a command, the password with the entered name for the user will be requested. Confirmation of the password will be requested after input of the password.

4. Now it is necessary to check existence of the file of passwords. ls - all – execute this command. The file name of passwords should be present at the displayed list of all contents of the current directory.

5. Add users to whom access will be allowed. htpasswd – execute a command of such view.

6. Be disconnected from the server. Now enter exit and confirm a command, having clicked Enter. Change the .htaccess file. By means of the program of the FTP client be connected to the server. Come into the directory which corresponds to the section of the website for which authorization is necessary. So there has to be a file under the name .htaccess – load it on the PC.

7. Come into the section of the website for authorization system operation check. The browser will display a dialog with data for authorization if everything works correctly.

Author: «MirrorInfo» Dream Team


Print