What EUID 0?
Privileged processes (those with EUID = 0, a.k.a. root ) can set EUID and RUID to arbitrary values (for example, the login , su , and sudo programs do that). Generally, once a privileged process changes its UIDs to non-zero values, it is no longer privileged and cannot become root again.
What is the difference between real user ID and effective user id?
So, the real user id is who you really are (the one who owns the process), and the effective user id is what the operating system looks at to make a decision whether or not you are allowed to do something (most of the time, there are some exceptions).
What’s the difference between effective UID and setuid root?
When a setuid root program like su is executed, the effective uid is set to 0, but the real uid stays the same. The effective uid is, as the name says, the uid that is used for permission checks, the real uid just tells “who we really are”.
How to set the UID of a process to zero?
A process with an effective uid equal to zero can successfully call setuid (0) to change the real uid to zero. The executable’s file needs to be owned by some_uid 1.
Why are processes treated as non root in Kubernetes?
This allows for a process to run as UID 0 (root) inside the container while being UID 100000 (or any other UID) on the host. If then a process breaks out of a container the kernel will treat its effective user as the mapped non-root UID, and that process won’t have root privileges on the host.
Can a process run as root with CAP _ SETUID?
Programs running as user ID 0 receive all capabilities unless they go out of their way, and programs running with CAP_SETUID can acquire root privileges, so in practice running as root and having CAP_SETUID are equivalent. Linux has several security frameworks that can restrict what a process can do, even if that process is running as user ID 0.