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
- root user — The all-powerful administrator account on Linux, with user ID 0, which can read or change anything.
- id command — The command that prints the user and group identity a command is running as.
- file permissions — Rules on each file saying which user and group own it and who may read, write or run it.
- non-root user — An ordinary user account with limited rights, which a container should run its service as.
- USER — The Dockerfile instruction that sets which user later instructions and the container run as.
- user namespace — The namespace that can map the root user inside a container to an unprivileged user on the host.
- user account — The record that lets a person or service use a Linux system, tying a login name to a UID, a primary group, a home directory and a login shell.
- effective user ID — The identity the kernel uses for a process's permission checks, which can differ from the real user ID of the person who started it.
Taught in
- Connections And Privilege Escalation — Ansible Configuration Management at Scale
- Permissions And Ownership — Bash Scripting & Command Line Automation
- The Host Footprint: Six Doors On A Worker — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Container Hardening: Distroless & Rootless — Cloud Security & DevSecOps Engineering
- Runtime Anomaly Detection with Falco & eBPF — Cloud Security & DevSecOps Engineering
- FROM, WORKDIR, COPY And ADD — Docker Architecture & Production Containers
- RUN, SHELL And Efficient Layer Caching — Docker Architecture & Production Containers
- CMD, ENTRYPOINT, USER And Process Signals — Docker Architecture & Production Containers
- Minimal Bases, Non Root Users And Smaller Images — Docker Architecture & Production Containers
- Bind Mounts, Permissions And Backups — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Users, UIDs And The Password File — Linux Fundamentals & Systems Administration
- Groups, And How Shared Access Is Granted — Linux Fundamentals & Systems Administration
- Setuid, Setgid, And Root Through sudo — Linux Fundamentals & Systems Administration
- Diagnosing Permission Problems — Red Hat Certified System Administrator (EX200) Exam Prep
- VFAT, ext4 And XFS: Create, Mount, Use — Red Hat Certified System Administrator (EX200) Exam Prep
- Drill: People, Packages And Time — Red Hat Certified System Administrator (EX200) Exam Prep
- Mock Exam, Part 1: Eighteen Tasks, One Reboot — Red Hat Certified System Administrator (EX200) Exam Prep
- Windows Event Logs, Sysmon & Linux Auditd Telemetry — Security Operations & Threat Hunting (SOC)
- Tracking Advanced Persistent Threats & Profiles — Security Operations & Threat Hunting (SOC)
- Recovery & System Validation Testing — Security Operations & Threat Hunting (SOC)
- Container Security: Minimal Bases And Non Root — Application Security & Threat Modeling for Engineers
- Starters, Leavers And A Service Account: Accounts On Two Families — CompTIA Linux+ (XK0-006) Exam Prep
- Who Wrote That Sudoers File? The Journal, rsyslog, logrotate And auditd — CompTIA Linux+ (XK0-006) Exam Prep
- When awk Runs Out: Python Data Types, Modules And Virtual Environments For Admins — CompTIA Linux+ (XK0-006) Exam Prep
- Drill: Volumes, Swap, A Share And A Team Directory — Linux Foundation Certified System Administrator (LFCS) Exam Prep
- Mock Exam, Part 1: Seventeen Tasks, One Reboot — Linux Foundation Certified System Administrator (LFCS) Exam Prep
- Account Files: Every Answer Is A Field — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep
- Variables And Where They Win: group_vars, host_vars And Play Vars — RHCE in Ansible (EX294): Automate Red Hat Systems
- Loops: One Task, Many Items — RHCE in Ansible (EX294): Automate Red Hat Systems
- Users And Groups From A List, With Passwords That Settle — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: People, Passwords And sudo From The Vault — RHCE in Ansible (EX294): Automate Red Hat Systems
References
Certification courses
- CKS course and practice exam: Certified Kubernetes Security Specialist
- RHCSA course and practice exam: Red Hat Certified System Administrator (EX200)
- CompTIA Linux+ course and practice exam: XK0-006
- LFCS course and practice exam: Linux Foundation Certified System Administrator
- LPIC-1 course and practice exam: Linux Administrator (101-500 and 102-500)
- RHCE course and practice exam: Red Hat Certified Engineer in Ansible (EX294)