Owner, group, others

Source: Internet
Author: User
File Permissions

There are three types: (1) users (2) groups (3) Others

File owner

The first time I came into contact with Linux, I thought it was weird 『In Linux, there are so many users. What groups are there?』. This "user and group" function provides sound and easy-to-use security protection! What should I do? Linux is a system with multiple tasks, so many people may use this host at the same time. In order to consider the privacy of each person and the work environment that everyone prefers, this "file owner" role is very important!

For example, if you transfer your email love letter to a file and put it in your home directory, you do not want others to see your love letter? At this time, you set this file to "only the file owner, that is, me, can view and modify the content of this file 』, so even if other people know that you have a file that is quite "interesting", but because you have set the appropriate permissions, others naturally cannot know the content of the file!


What about groups? Why are there groups in the configuration file case? In fact,One of the most useful functions of a group is when you develop resources in a team.! For example, assume that there are two groups of topics in my host. The first topic group is projecta, which has three members: class1, class2, and class3. The second topic group is projectb, the members include class4, class5, and class6. The two topics are competitive, but the same report must be handed in. Each group of Members must be able to modify each other's data, but other group members cannot see the contents of their own files. How can this problem be solved?

In Linux, such restrictions are very simple! Through simple File Permission settings, I can restrict others who are not in my own team (that is, a group) from reading the content! You can also allow your team members to modify my files! At the same time, if I still have private and confidential files, I can still set them to make my team members invisible to my file data. Very convenient!

In addition, if the teacher account is the teacher of the Project TA and project TB topics, he wants to observe the progress of the two topics at the same time, so he needs to be able to access the permissions of the two groups, you can set the Account "teacher" to support both the projecta and projectb groups! 』, That is to say:Each account can have support from multiple groups.!

In this case, it may not be easy for you to understand the relationship between the user and the group? It doesn't matter. We can use the current "family" concept to explain it! Suppose there is a family with only three siblings, Wang damao, Wang ermao, and Wang sanmao. The family is registered under Wang damao! Therefore, Wang damao has three people, Wang damao, Wang ermao, and Wang sanmao. Both of them have their own rooms and share a living room!

    • User Significance: Because the three members of the Wang family have their own rooms, although Wang ermao can enter Wang sanmao's room, but ermao cannot flip the drawer! It will be 3 hairs! Because there may be three hairs in the drawer, such as love letters, diaries, and so on. This is a "private space", so of course we cannot let two hairs take it!

Group concept: Because they share the living room, the three brothers of the Wang family can turn on the TV, read the newspaper, and sit on the sofa! Anyway, as long as it is in the living room, three brothers can use it! Because everyone is a family!

So I should have known it! The "Wang Da Mao jia" is the so-called "group". As for the three brothers, they are three "users" respectively, and these three users are in the same group! Although three users are in the same group, we can set "Permissions" so that the personal information of some users is not queried by the group owner, to keep your personal private space! You can share group sharing with us!

Concepts of others

Well, today there is another person called Zhang pig. He is from Zhang pig's house and has nothing to do with Wang's house! At this time, unless the Wang family knows Zhang pig and opens the door to let Zhang pig in the Wang family, Zhang pig will never be able to enter the Wang family, let alone go to Wang sanmao's room! However, if Zhang Xiaozhu knows sanmao through the relationship and becomes a good friend with Wang sanmao, then Zhang Xiaozhu can go to the Wang family through sanmao! Haha! That's right! The Zhang pig is the so-called "others, others!

Therefore, we can understand that in Linux, any file has individual permissions of "user, group, and others, we can explain the above description in the following illustration:

The owner, group, and others of each file

Let's take Wang sanmao as an example. The owner of Wang sanmao's "file" is Wang sanmao. He belongs to Wang damao's group, while Zhang pig is opposite to Wang sanmao, it's just a "others.

However, there is a special character here to introduce, that is, the "omnipotent God 』! This God has infinite power, so he can reach any place he wants to go, huh, huh! The identity code in Linux is "root! So be careful!The root is a "omnipotent God!

In any case, the "user identity" and the "Group" concept supported by this user are quite important in the Linux World, it helps you easily manage your multi-task Linux environment!


From http://vbird.dic.ksu.edu.tw/linux_basic/0210filepermission_1.php

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.