Linux user identity introduction

1. Understand the concepts of single-user multi-tasking and multi-user multi-tasking in Linux;

Linux is an 多用户、多任务的operating system; next, the concepts of single-user multitasking and multi-user multitasking are introduced;

1. Linux single user multitasking

Single user multitasking: For example, we log in to the system as beinan. After entering the system, I want to open gedit to write the document, but in the process of writing the document, I feel less music, so I open xmms to listen to music; of course listen to music No, MSN still has to be opened. I want to know what a few brothers are doing now. In the same way, when I logged in as user beinan, I executed gedit, xmms, msn, etc. Of course, there was the input method fcitx; Simple, a beinan user performs several tasks in order to complete the work; of course, beinan user, other people can log in remotely and can also do other work.

2. Linux multi-user and multi-task

Sometimes it may be that many users use the same system at the same time, but not all users must do the same thing, so this is said to be multi-user and multi-task;

For example, such as LinuxSir.Org server, there are FTP users, system administrators, web users, regular ordinary users, etc. At the same time, some brothers may be accessing the forum; some may be uploading package management sub-site, For example, Luma or Yuking are managing their homepage system and FTP; at the same time, there may be system administrators maintaining the system; the homepage is browsed by nobody users, everyone uses the same one, and upload software packages It is an FTP user; the administrator ’s maintenance or viewing of the system may be an ordinary account or a super-privileged root account; different users have different permissions, and different users are required to complete different tasks. It can also be said Different users may complete different work;

It is worth noting that multi-user multi-tasking does not mean that everyone squeezes the keyboard and display of a machine to operate the machine at the same time. Multi-users may perform remote login, such as remote control of the server, as long as there are users Anyone can go up to operate or access;

3. The user's role distinction

Users are divided into roles in the system. In Linux systems, due to different roles, permissions and completed tasks are also different; it is worth noting that the role of the user is identified by UID, especially UID;

In system management, the system administrator must adhere to the unique characteristics of UID;

root user: The system is unique and real, you can log in to the system, you can operate any file and command in the system, and have the highest authority;

Virtual users: These users are also called pseudo users or fake users. They are distinguished from real users. Such users do not have the ability to log in to the system, but they are users who are indispensable for system operation, such as bin, daemon, adm , Ftp, mail, etc .; such users are owned by the system, not added later, of course, we can also add virtual users;
ordinary real users: such users can log in to the system, but can only operate the contents of their home directories; Limited permissions; these users are added by the system administrator;

4. Security of multi-user operating system

In fact, multi-user systems are more convenient for system management. From a security point of view, a multi-user management system is more secure. For example, a file under user beinan does not want to be seen by other users, but just sets the file permissions. Only one user in beinan can read, write, and edit. In this way, only one user of beinan can operate on their private files. Linux performs best under multiple users. Linux can protect each user's security very well, but we also have to learn that Linux is the most secure system. Without a security-conscious administrator or management technology, such a system is not secure.

From the perspective of the server, system security under multi-user is also the most important. Our commonly used Windows operating system, its ability to manage permissions in the system can only be said to be average, there is no way to interact with Linux or Unix System comparison

2. The concept of user and user group

1. The concept of user

Through the previous understanding of Linux multi-users, we understand that Linux is a real multi-user operating system, so we can build several users in the Linux system. For example, our colleague wants to use my computer, but I do n’t want him to log in with my username, because there are materials and information (that is, private content) that I do n’t want others to see under my username. He built a new user name and let him use the user name I opened to toss, which is in accordance with the operation rules from the perspective of computer security;

Of course, the user (user) concept is not limited to this, there are some users in the Linux system are used to complete specific tasks, such as nobody and ftp, etc. We visit the LinuxSir.Org web program, is the nobody user; we When accessing ftp anonymously, the user ftp or nobody will be used; if you want to know some accounts of the Linux system, please check / etc / passwd;

2. The concept of user group (group)

A user group is a collection of users with the same characteristics;

For example, sometimes we want to allow multiple users to have the same permissions, such as viewing, modifying a file, or executing a command. At this time, we need a user group. We define the users to the same user group. We modify the file or directory by Permissions, so that the user group has certain operation permissions, so that the users in the user group have the same permissions on the file or directory, which is achieved by defining the permissions of the group and modifying the file;

Example: In order for some users to have permission to view a document, such as a timetable, and the person who writes the timetable must have read and write execution permissions, we want to let some users know the contents of this timetable without letting them Modify, so we can divide these users into a group, and then modify the permissions of this file to make the user group readable, so that every user under the user group is readable;

The corresponding relationship between users and user groups is:一对一、多对一、一对多或多对多;

一对一:A user can be the only member of a group;
多对一:multiple users can be members of a unique group, and do not belong to other user groups; for example, the two users beinan and linuxsir only belong to the beinan user group;
一对多:a user can be Members of multiple user groups; for example, beinan can be a member of the root group, a member of the linuxsir user group, or a member of the adm user group;
多对多:multiple users correspond to multiple user groups, and several users can belong to the same group ; In fact, the many-to-many relationship is an extension of the previous three; understanding the above three, this can also be understood;

Published 19 original articles · praised 211 · 10,000+ views

Guess you like

Origin blog.csdn.net/qq_44723773/article/details/105522254