LINUX / A CONCEPT NOTE

Users & Sudo

the permission model

~60 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

Linux secures resources by isolating users. Sudo (superuser do) lets authenticated users execute commands with root (UID 0) privileges according to /etc/sudoers rules.

02 / FOLLOW THE MECHANISM

How privilege escalation flows

  1. Command

    user types: sudo apt update.

  2. Verification

    sudo checks /etc/sudoers to see if the user is authorized.

  3. Password Prompt

    user enters their own password to verify identity.

  4. Execution

    sudo launches the command as root UID 0.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

check current active user name

whoami

EXAMPLE 02 · REFERENCE

open an interactive shell session as root

sudo -i

Explore command anatomy in the CLI lab