Explanation of Linux Privilege description

Source: Internet
Author: User

Recently seen in Android or Linux, there are many-rwx-wx-wx such things, know that the permissions of the file description, but not very carefully understand, through the network query, through their own language, write down it.

Linux divides the file's permissions into read (R), write (W), execute (x) three, each file has three sets of R, W, x permissions, corresponding to the file owner rwx permissions, the file owner's user group's rwx permissions, and all other users except the file owner and the user group where the file belongs.

Use the Ls–l command to view permissions for a file or folder. For example, how do you understand that a file has a permission of –rwxr-xr--? In fact, the entire permission description string is 10 characters in total. The first character represents the type, "-" means the file, so here refers to a file's permissions, the next 3 characters "Rwx" represents the user to the file has R (read), W (write), X (Execute) permission, then the next 3 "R-x", Represents the user group for which the file belongs to has R (read), X (execute) permission, and no W (write) permission, and no corresponding permission is substituted with "-" in the corresponding bit. The next 3-bit "-w" means that all users except the file's owning user and the user group that owns the user have R (read) permissions to the file, without the W (write) and X (execute) permissions. The number represented is 754.


Here's a summary of the rules for permission characters:


L Altogether 10 bits, the first digit represents the type, "-" represents the file, "D" represents the folder

The 2nd to 4th bit, which represents the permissions that the file or folder belongs to the user, in order rwx, and if not, use "-" instead on its bit.

The 5th to 7th bit, which indicates the permissions that the user group that the file or folder belongs to is in, the order is rwx, and if that permission is not, use "-" in its place instead.

L 8th in the end 10 bits, indicates that the file or folder in addition to its own user and the user group belonging to the other users of their users have permissions to it, the order is rwx, if which permissions are not, in its place with "-" instead.

L If the numbers indicate, r=4 w=2 x=1 for each part, the sum of the maximum is 7. If it is not easy to remember, it can be remembered that the RWX,R bit is 2 of the 2-time square =4,w bit is 2 of the =2,x bit is 2 of 0 square = 1.


Do you already know the meaning of these privileges?

Explanation of Linux Privilege description

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.