Process Permissions
100%

Permissions · Lesson 7

Process Permissions

Learn how real, effective, and saved user IDs help Linux processes track callers and manage privilege.

Linux authorization checks act on process credentials rather than directly on a typed username. A process has several related user and group IDs, each serving a different role. Most ordinary programs start with matching identities, while privileged programs can use distinct values deliberately.

Real User ID

The real user ID identifies the account that started the process or its ancestor login session. Programs can consult it to distinguish the caller from an elevated effective identity.

For an ordinary command started by user Bob, the real user ID normally equals Bob's UID. Creating another process does not create a new account or change this identity by itself.

What does a process's real user ID normally identify?

Effective User ID

The effective user ID is the user credential used for many filesystem and privilege checks. Ordinarily it matches the real UID. Executing an honored setuid program can instead initialize it from the executable's owner.

For example, a carefully designed password utility may run with an elevated effective UID so it can update protected authentication data. The program must still enforce policy based on the caller, requested account, PAM results, and other context. Possessing an effective UID does not automatically make every requested operation legitimate.

Which user ID is used for many access-control decisions made on behalf of a process?

Saved Set-User-ID

The saved set-user-ID lets a program retain an identity it may later restore, subject to the system-call rules. A privileged program can temporarily switch its effective UID to a less privileged value, perform ordinary work with reduced authority, and restore the saved identity only for a narrowly scoped operation.

This is safer than retaining elevated authority throughout the entire program, but only when implemented correctly. Programs should permanently discard privilege when it is no longer needed and check every credential-changing call for failure.

Why can a privileged program retain a saved set-user-ID?

User IDs Are Only Part of the Credential Set

Processes also have real, effective, saved, and supplementary group credentials. Filesystem IDs, capabilities, namespaces, security modules, ACLs, mount options, and service policies can further affect authorization. Therefore, “the UID allows it” is often only part of a complete explanation.

Use tools such as ps and /proc/PROCESS/status to inspect credentials on Linux. Field availability and display formats vary, so consult the local documentation and avoid changing credentials merely to experiment on a shared system.

For most ordinary commands without a privilege transition, how do the real and effective UIDs compare?

Lesson complete

You finished Process Permissions

You can now explain why a Linux process can carry several user identities.

  • Use the real UID to identify the original caller.

  • Relate the effective UID to active authorization checks.

  • Use the saved identity to understand controlled privilege transitions.

  • Consider group IDs and additional security mechanisms as part of the full decision.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Permissions