We know that Linux system is a multi-user multi-tasking operating system, that is, different users have different permissions to the same file, so let's see what permissions and attributes for Linux:
First, the property file: owner group other
1, the owner of the file: for example, at home, your bedroom is a file, this is your master bedroom, you are the owner of this bedroom, you can store some of your own private items in the bedroom, others have no right See!
2 Groups: at home if the family seen as a group, and each family is this group one, the family living room are open for everyone at home who has the right of every in the living room doing the things they want, the living room is a part of this group of files, and the members of the family belongs to the user group;
3, others, such as a friend's house of a member, is one other person in the house that did not belong to his place, he has no authority, so that other people!
Second, the file directory permissions: rwx
1, r file (read) permissions: if a user permissions on this file only r, then the user can only view the files can not be edited!
2, w (write) permission to file: If a user has only w permission can only edit this file, you do not see the contents of existing files
3, file x (execute) permissions: execute permissions for the file, the file depends on the file is not able to perform
4, the directory r (read) permissions: directories and files a little different, if the user is the only r directory permissions, the user can only see the directory exists, but can not be less likely to make some of the directory in this directory operating!
6, rx directory (read execute) permissions: Users with this permission can enter this directory, after entering only be viewed, not write operations
7, rwx directory (read write execute) permissions: With r directory permissions can be seen with x can enter the directory and read, with w permissions can write in this directory, such as modifying delete, etc. New operating!
Third, modify the file directory permissions, properties:
1, modify the files group: chgrp
Column 1: chgrp [-r] groupname dirname / filename (-r is recursive, provided that the groupname this group exists)
2, modify the owner of the file: chown
Column 1: chown [-r] ownName dirname / filename (prerequisite is to have ownName this account)
3, modify the file permissions, command chmod, but modify the permissions in two ways, namely, numbers and letters:
(1) They are owner / group / others Three Identities have their own read / write / execute permissions
(2), the file permissions for the characters: "- rwxrwxrwx" nine permissions are three groups of three! Among them, we can use numbers to represent each permission, scores table for each permission as follows:
(3), three permission Three Identities is to accumulate: such as a file permissions for [-rwxr-xr-x] then the corresponding data is: owner: 4 + 2 + 1 group: 4 + 1 other : 4 + 1
(4) If you give a file to give [-rwxr-xr--] permission to do so can be expressed as: chmod 754 filename
(5), with 4 to this file as given the same privileges as the class symbol to achieve the following: chmod u = rwx, g = rx, o = rx filename
Interpretation (6), notation
(7), this figure comes from private kitchens affirmed Bird Brother
(8), we use the time that the above uses the + = and - a number that role, I take a look at the full:
chmod u + w filename indicates that this file has a permission to add the w
chmod u - w filename indicates the file owner lost this authority w
And wherein the group other user is the same
(9), a special character he represents all that is meant is that all include: user group other three properties!
Four, a file, a directory of authorized users to:
1, we see in the above are modified to delete the file owner, group, etc., let's grant permission to a different file of different users;
2, see the acl set file attributes: getfacl file name / directory name, you can see information about the acl file directory: getfacl test
3, both the owner and the group for the test file a SUSEr authorized users, only the file rx permissions: setfacl -m u: Suser: rx / test