science technology engineering maths , mathematics business science technology
Thursday, November 12, 2009
File permissions in Linux
File permissions in Linux Linux operating system uses a system of permits to define the rights of users for each file. These permits: Who can read the file. If the file is a directory, it means reading the contents of the directory. Who can write / edit the file. If the file is a directory, that, if defined, you can modify all the contents of the directory, such as creating or deleting files. Who can run the file. If the file is a directory, it is defined, if this authorization, you can use the directory and its contents, for example, a search in the directory or a program. Permissions are added to the file owner, the owner to select the file of the group and for all users. For example, you can create a file readable and writable only by the owner and only read all the others. If you have an ls-l command to display all the contents of the directory, you can see how these files are next to each file:-rwxrwxrwx This means that this file can be read, written by someone. The first line means that this file is not a directory. For directories, Ad-letter, instead of a hyphen. The first set of "rwx" refers to the owner. The second set, the group owner. The last sentence, for all other users. Some examples:-rwxr - - r - - This file can be read, written by owners. It can only be accessed by other users. If permission is not set, you can see a hyphen in its place. -rw-rw-r - This file can be read and written by his owner and the owner of the group. It can only be accessed by other users. You can change these permissions using the chmod command. For example, this command: chmod ugo = rwx file name is read, write and execute for owner user (u), group (g) and (o). Another example: chmod ug = rw, o = r filename grants read and write access to the user and group, and only read for others. Permissions can also be expressed with the help of the octal number system. Each permit is limited to a series: Read = 4 Write = 2 Execute = 1 you have to do with a number for the owner, another number for the group and a final one for the other users. If you want to assign read, write and execute files on the owner to obtain the three values in order to get a 7. If you want equal rights for the group and others, we arrive at three of seven. You can change these permissions as follows: chmod 777 filename If you have permissions for a file with the following command: chmod 764 filename then you are setting these rights: read, write and execute for owner (4 +2 +1 = 7) , read and write permissions for the group (4 +2 = 6) and other read-only (4). The following commands are equivalent: chmod ug = rw, r = filename or chmod 664 filename The file scheme might be for the implementation of security policy. It is not a good idea to file high (eg 777) for all files. It is important to remember and assign the correct permissions for the file, so users can work, and are sure that each file is only the right people.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment