UID and GID

The numbers Linux uses to identify a user (UID) and a group (GID); root is UID 0.

In more detail

Names can change or be duplicated, but the kernel checks only these numbers. The id command prints them for the current account.

Examples

id -u returns 0 when a task runs as root and another number when it runs as an ordinary user.
UID stands for user ID and GID for group ID. Files and processes store these numbers, not names, so renaming an account does not change who owns its files. Diagnose an access problem by resolving the name to its UID with id, then comparing it with the file's numeric owner.
auditd shows uid=0 for commands run through sudo; auid shows who logged in.

Related terms

Taught in

References

Certification courses