Real UID vs effective UID: what's the difference?
AdvancedConceptPermissions, Users & sudo
Answer
The real UID is who started the process; the effective UID is what the kernel uses for permission checks. They differ for SUID programs: running passwd, real UID is yours, effective UID is 0. There is also a saved set-UID that lets a program drop privileges and regain them. See them in /proc/<pid>/status (Uid: line shows real, effective, saved, filesystem).
More on Permissions, Users & sudo
Explain the rwx permission model for files and directories.BeginnerHow does octal notation work in chmod?BeginnerWhat does chown do and who can run it?IntermediateWhat is umask and how is the final permission calculated?IntermediateWhat is SUID and give a real example?IntermediateWhat does SGID do on files versus directories?Intermediate