How to set access rights

How to set access rights

Directories and files have sets of attributes on the basis of which the software of the Web server defines what it is authorized to do with this file or the folder to each specific user or user group. Such set of attributes is called "access rights". It is described below how to create and expose the necessary value of access rights to files and folders.

Instruction

1. The majority of Web servers works now at base of UNIX-SYSTEMS in which all users are divided into three groups: ""user"" (this is the owner of the folder or file), ""group"" (this is the member of one with the owner of the file group) and ""world"" (all this other users). At each accessing the file the server defines belonging of the author of request to one of these groups. For example, if you enter on the website under the FTP protocol, entering the password and a user name, then the server carries you to the user group. If except you there are other users entering under the FTP protocol, then they will be carried to the group group. And when the browser of the visitor of the website sends a request for the file, this user will be carried to the world group. Each user classified thus acquires a set of the rights - to write, read or run the file. For example, that the request of the visitor of the website read from the directory and started execution of a script, this script should have the resolved attributes of reading and execution for the world group. And that you as the owner, had an opportunity under the ftp-protocol to create the new directory or the file in any existing directory, at this directory the allowing attribute on record for the user group should be exposed.

2. Now how sets of the rights of users are coded. Each such set consists of three numbers: the first sets the rights for the user group, the second - for the group group, the third - for ""world"". Each number is a combination of digital codes of operations: 4 - means the right for reading (read)
2 - right for record (write)
1 - the right for execution (execute) For example to install the right for record and execution of the file for one of groups, it is necessary just to put the corresponding digits (2+1=3). The right for a read and write, respectively, will be acquired by addition 4+2=6. In total seven options are possible: 1 = execute
2 = write
3 = write + execute
4 = read
5 = read + execute
6 = read + write
7 = read + write + executetakim in the way, for example, to set the fullest authority for any file for each of three groups, it is necessary to expose it a set of attributes which is expressed by number 777.

3. Now about practical establishment of the rights of users by means of the FTP-client. For establishment of attributes of access the CHMOD UNIX command is used (reduction from CHange MODe). All modern FTP-clients send such command automatically - to enter it manually there is no need, it is enough to enter the corresponding numeric expression of attributes, or just to expose the necessary ticks in the corresponding checkboxes. The most important for you - is correct to combine the necessary values of attributes described in the previous step.

Author: «MirrorInfo» Dream Team


Print