I don't understand it. Let's take a look at it ~~~
Source: Internet
Author: User
I don't understand it. Let's take a look at it ~~~ -- Linux general technology-Linux technology and application information. For details, refer to the following section. Comparison between windows and linux
I briefly talked about the multi-user mechanism in linux from a historical perspective. I learned that many users in linux are inherent, and many users in unix are also history-driven, it is also born, but if we want to explain the concept of multiple users from the perspective of access control, we should say more. After all, in a sense, the concept of multiple users is introduced, this is because access control is required, that is, to "do not tamper with things that are not your own". In fact, it is precisely because many users need access control to operate computers. If we want to talk about multiple users from the perspective of access control, we need to talk about windows's multi-user mechanism, that is, its role-based multi-user mechanism, but before talking about windows, let's talk about linux access control first.
Multiple users in linux are protected based on resources. Several concepts are abstracted here. One is the subject, that is, the access object is the resource execution thread, it can be understood as a process (unix/linux Process). One is the main character, that is, the entity of the main agent. The main character can be understood as a user, and the other is an object, that is, resources in linux, it is a passive entity restricted by Access Control. in linux, everything is a file, so the object here is a file. The fact is that all operations are performed by processes, and all resources are accessed by processes. It is meaningless to say which resources and processes cannot be accessed. Only when users (the main character) when bound to a process (subject), access control starts to take effect. In this case, access control is implemented between the user, the principal and the object, and the resource. There are two meanings, one layer is on the user side, indicating that a user can access and how to access resources. The other layer means that a resource can be accessed by and how to access resources, the first layer indicates the traditional unix "Capability" concept, and the second layer indicates "access control list (ACL)". Note, access control does not have much to do with processes. It just expands between users and resources. It seems that the murder of the murderer has nothing to do with the knife, but it is only related to the person holding the knife and the person killed, both executors and killers take the same knife and kill people. However, they have different meanings. Therefore, a process is a subject. It must represent a major character before being able to exercise power,. The above access control and multi-user on unix/linux introduces the concept of Role-Based Multi-user on windows.
Windows users are not inherent because they do not need to face multiple terminals or undertake large-scale computing. They are born directly for end users, therefore, the significance of multiple users in windows is an access control, and there is no relationship between multiple terminals, virtualization, and multi-channel programming. However, many users of Role-Based Access Control are much more complex than those of unix. People familiar with man-machine scales should know that, windows security policies should be at the human-machine ruler's end, while unix/linux should be at the machine's end. In linux, both the capability mechanism and the resource acl can stop everything, because unix/linux is at the machine end, it protects unified vfs files, rather than the world. Simply put, windows's access control policy is a super version of the unix capability mechanism, because windows controls access by limiting the subject/main character, in windows, in order to achieve such access control, the operation is first classified, and then a batch of operations are allowed or denied to a "role ", this indicates that the role can or cannot perform this operation. Once a subject (thread) is started, that is, CreateThread is called, a security descriptor must be initialized first. We will discuss the details later, then Initialize an access token. When you want to access a passive object, check whether the token is allowed. If yes, check whether the ace in the security descriptor of the passive object allows access from the subject. If yes, otherwise, an error occurs.
In linux, a process can take a user ID as the subject, because it wants to access a file (everything is a file ), this user can access all objects in the File acl. However, in windows, when a main body, namely, a process/thread, accesses an object, it is not a user ID, but a token, this token has more information than the user ID in linux, including the SID. When the subject accesses an object, the security management organization compares the SID in the token with the SID in the ACE in the security descriptor of the accessed object, finds all the operations that the SID can grant, and finally completes access control. The resulting user process (subject) generates an access token from this SID, and then access the object, such as files, devices, and processes. When windows creates a new user, it initializes a struct for the user to generate a security-related structure when the user logs on. This is the windows Multi-User mechanism, role-based, here a role is a set of operations. windows does not try to set a single one-time access control list on passively accessed objects to permanently implement access control, in actual access, the access control is dynamically monitored through the token of the subject and the security descriptor of the object. the token and Security Descriptor are both dynamically generated when the object is created, instead of static settings such as chmod in linux. Here is a very special feature of windows. If unix/linux is a file, windows is "Everything is an object, each object can have its own unique security information, so that it can meet the rich (complex) application requirements.
In linux, the creation process is fork, the creation thread is clone, and the Creation file is open. Let's take a look at their parameters. It is simpler than one, and there is no security-related thing, that is to say, in linux, security is just an object attribute. Its setting and creation are separated, and the advantages of small particles are displayed again (disadvantage ?); In windows, everything is an object, and when creating an object, there must be a parameter, that is, the "Security Descriptor" pointer, that is, the parameter LPSECURITY_ATTRIBUTES lpSecurityAttributes, such as CreateFile, createProcess, CreateThread, and so on. Security is the primary factor for all. Therefore, when creating an object, you must add security attributes as part of the object to be created, in this way, no gaps will be left for any insecure factors. In windows, processes and threads are no longer given a very important position as in unix/linux. They are just an object in windows. In terms of design, all objects are no longer opposed to direct access between processes. In fact, the original process architecture (which is actually unix) indicates that address space isolation is required between processes, it is very opposed to direct mutual access between processes, but all objects in windows push forward the meaning of the process. The process is not a special thing, it is an object, as long as the visitor gets an access token, in addition, if the security descriptor of the Process object allows access by visitors, access is allowed. It seems that the idea that everything in windows is an object has changed the meaning of the process and the meaning of the operating system. The sequence of windows design is that all objects are the most basic. Secondly, role-based access control is implemented, and role-based user concepts are created for convenience. Finally, remember that multiple users in windows are generated by access control. It is not a concept that requires multiple users to use computers at the same time, therefore, its implementation is more "policy.
Next, let's take a look at the concept of "group" in linux and windows. Both systems have this concept, but the implementation is quite different. in linux, the group is a group of users, for example, configuration files and programs related to web services are listed as web groups. In windows, a group is a group of privileges. Some operations are listed as a group and a security structure is assigned, for example, SID and other structures are actually an intermediate layer for further classification. The difference between the two systems is that they have different positions on the human-machine ruler.
In fact, windows is very secure. It always has problems because of users, not the operating system itself. Windows security is the security of objects, and all object security is encapsulated in object security descriptors. How many people really care about this security descriptor, the security parameters when an object is created are ignored in windows books written by many people or even Chinese people. The default dangerous settings on the way still blame the system for being insecure, not the system being insecure, people do not have the security concept. Windows's policy is to get users lost in complicated operations. The irony is that people do not pay for complicated security operations, however, many people will read operation manuals such as ms word to familiarize themselves with complicated document operations. Think about it, the reason why windows's security mechanism is on the left of the human-machine ruler is that it takes into account the habits of people. It is oriented to people, while linux is on the right of the human-machine ruler, in this way, it is invisible and transparent to users to some extent. For windows users, they must be very clear about this point. Otherwise, their systems will be very dangerous, machine-oriented policies can be completed by the system, but human-oriented policies cannot expect the system to look at the security parameters of object creation functions, which is exactly the embodiment of "human-oriented, if you ignore this security parameter, the system security will also ignore you.
Windows's complex access control mechanism is sometimes more secure than linux. For example, in windows, the user account sid is allocated immediately, while in linux, it is created based on the provided information, in other words, the uid and gid in linux are the same when the provided information is the same, while in windows, the sid is generated by a pseudo-random number. Therefore, after an account is deleted, windows also deletes all permissions of this user. Even if you create an account with the same name with the same information, all permissions will be lost, however, in unix/linux, the root account is reserved unconditionally, and other accounts are managed dynamically. If I delete Account B and create Account B, all permissions of original account B will be reserved, after all, in linux, the uid/gig acl of the simple file system is used for management. In windows, there are only two types of accounts, one is the administrator account and the other is the restricted account, all permissions are dynamically generated. In this case, it seems difficult to manage such information. In fact, the restricted account permission in windows is actually very simple. Limits are dynamically generated. Because windows is based on objects, the object security descriptor plays a major role.
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