Actual user ID and valid user ID, set user ID, ownership of new file, directory

Source: Internet
Author: User
Tags valid
The actual user ID is what the user is when you log in to the system.

A valid user ID is when you are logged in as a user, but when you run a program, it is not necessarily the identity that is in effect (Lenovo passwd this command). That is, when you execute this process, which identity is in effect, this identity is a valid user ID.

Set User ID refers to a mechanism, if you set a file settings user ID bit, this program is running, you will get the permissions of this file owner. In other words, when you run this file, your valid user ID is not your actual user ID (usually the two are the same), but the UID of the file owner.




The actual user ID is your ID number.

Valid user ID is someone else's ID number, which is useful at some point, such as your father is very busy, you take your old ID card (in fact, you pretend to be your father more accurate, because at this time, in Unix semantics of "law", your behavior is considered your father's behavior)

Setting the user ID provides the possibility of implementing the above mechanism and may be considered an "authorization" behavior. In the example above, your father is the authorized person.

Compare the program to a form, this form is empty, but your father signed it. This signature is the action of setuid.
Now you can fill in the form with any content (run the program) on the form's frame limits. When you submit this form, all the content that is filled in will be considered your father's fill-in. That is, when you execute this program, you have all the rights of your father.

Chown change a.out file user is root,chmod change a.out can change suid is Set user ID. Can be opened but not readable.


3. New file, directory ownership new file, directory user ID set to a valid user ID for the process, about group ID,POSIX.1 allows the implementation to select one of the following as the new file group id:1. The group ID of the new file can be a valid group ID for the process. (Use this implementation in Ubuntu) 2. The group ID of the new file can be the group ID of the directory in which it resides.



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.