Services and User Management
A junior administrator logs in as the user dana (UID 1001) and runs the passwd command, which is owned by root and has the setuid bit set. While the command runs, the administrator inspects the process with ps -o ruid,euid,cmd. Which result should be displayed for the passwd process?
Show the answer
Correct answerA. Real UID 1001 and effective UID 0
A setuid executable keeps the invoker's real UID (1001) while the effective UID becomes the file owner's UID (0), which is what grants the needed privilege. Both values staying 1001 would mean the setuid bit had no effect, and the real UID does not change to the owner's.