Linux operating system uses a scheme permissions for user rights for each file defined. These permissions determine:
Who can read the file. If the file is read a list, the list of directory contents.
Who can write / edit the file. If the file is a directory that provides such a permit if you make changes to the Content directory, such as creating or deleting files.
Who can run the file. If the file is a directory that provides such a permit if you enter the directory and access to these pages, such as looking for the implementation of an inventory or run a program in it.
The permissions are assigned to the file owner, group owner of the file, and all users. For example, you can specify that a document must be readable and writable by owner only, and only readable by everyone.
If you have a ls, controls everything, to question the contents of a directory, you are the permissions of files, such as those next to each file, see:
-Rwxrwxrwx
This means that read this file can be written and directed by no one. The first line indicates that this file is not a directory. For directories, it will be a letter ad instead of a dashboard.
The first series, Äúrwx, AU refers to the owner of the file. The second series, the owners of the group. The last sentence, all other users. Or a couple of examples AOS:
-Rwxr – r – - -
This file can be read, written and directed by its owners. It can not be read by other users. If a permit is not defined, you will see a panel in his place.
-Rw-rw-r -
This file can be read and written by his owner and the owner of the group. It can not be read by other users.
You can use these permissions with the chmod command. For example, type this command:
chmod ugo = rwx file
assigns read, write and execute for the file owner (u), group (g) and other (o). This example further:
chmod ug = rw filename = r o
assigned read and write permissions for the user and group permission to read for others.
Permits may also be expressed and defined with the octal numeric system. Each license is associated with a number:
Read = 4
Write = 2
Run = 1
You must come with a number for the owner of the file, a different number for the group and one for other users. If you want to read, write and execute permissions for the owner to assign the file, add the three values to obtain a seventh If you want to assign the same permissions for the group and others, come with September 3, these permissions as follows:
chmod 777 file
If permissions for a file with the command:
chmod 764 file
then Aore establishing these permissions: Read, Write and Execute for the owner of the file (4 2 1 = 7), read and write access to the group (4 2 = 6) and for others to read (4).
The following commands are equivalent:
chmod ug = rw filename = r o
chmod 664 file
The pattern of temporary files allows you to implement security policies. This is not a good idea to file permissions high (eg 777) for all files. It is important to examine and assign permissions on files so that users do their work, and we are sure that every file accessible only by the right people.
Other post you might like;