I want to know the difference between euid, suid and ruid.
I know what the suid(set user ID) is, but I want to know the difference between those 3.

- 2,174
- 20
- 36

- 727
- 1
- 16
- 42
-
1https://en.wikipedia.org/wiki/User_identifier – user3439894 Nov 29 '15 at 13:21
-
Duplicate of [Difference between Real User ID, Effective User ID and Saved User ID](https://stackoverflow.com/questions/32455684/difference-between-real-user-id-effective-user-id-and-saved-user-id) – bain Nov 15 '19 at 13:16
1 Answers
A process has an effective, saved, and real UID and GID.
The Effective UID is used for most access checks, and as the owner for files created by the process. An unprivileged process can change its effective UID only to either its saved UID or its real UID.
The Saved UID is used when a process running with elevated privileges needs to temporarily lower its privileges. The process changes its effective UID (usually root) to a unprivileged one, and its privileged effective UID is copied to the saved UID. Later, the process can resume its elevated privileges by resetting its effective UID back to the saved UID.
The Real UID is used to identify the real owner of the process and affect the permissions for sending signals. An unprivileged process can signal another process only if the sender’s real or effective UID matches the receiver's real or saved UID. Child processes inherit the credentials from the parent, so they can signal each other.

- 2,400
- 1
- 25
- 39