1、外文原文 Note that the effective user ID is set to 0 when the program is run. You can use the chmod command with the u+s arguments to set the setuid and setgid bits on an executable file,respectively-for example: You can also use the chmod call with the S_ISUID or S_ISGID mode flags. su is capable of ch
2、anging the effective user ID through this mechanism.It runs initially with an effective user ID of 0.Then it prompts you for a password.If the password matches the root password,it sets its real user ID to be root as well and then starts a new shell.Otherwise, it exits,unceremoniously leaving you as
3、 a nonprivileged user. Take a look at the permissions on the su program: Notice that its owned by root and that the setuid bit is set. Note that su doesnt actually change the user ID of the shell from which it was run.Instead,it starts a new shell process with the new user ID.The original Shell is b
4、locked until the new shell completes and su exits. 10.5 Authenticating Users Often,if you have a estuid program,you dont want to offer its services to everyone.For example,the su program lets you become root only if you know the root password.The program makes you prove that you are entitled to become root before going ahead with its actions.This process is called authentication-the su program is checking to see that you are authentic. If youre administering a very secure system,you probab