Interview Prep/Linux/Permissions, Users & sudo

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).

All Linux questions Roadmap: Linux

More on Permissions, Users & sudo