World map

 

BM: Baca dalam Bahasa Melayu

World L2: Keys & Staff

Users, groups and sudo

You will learn: who is who on a server, what teams are for, and how sudo borrows the master key.

Checked with Linux (Debian 13) on 1 Nov 2026

The problem

Aina joins the kitchen tomorrow. She needs to use the server too. Should she log in as you?

Pick one answer.

Watch

You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

Empty folder

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

You are the user: One member of staff on the server, with a name, a number and their own keys. you, staff number 1000. You belong to two teams, called groups: you and sudo.

Predict

/etc/shadow holds every password, scrambled. You type cat /etc/shadow. What happens?

Pick one answer.

Try it

Team sudo may borrow the master key for one command. Try it: sudo whoami.

You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

Empty folder

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Check

Most jobs need no master key. Which ones do?

Drag a card into a box. Or tap the card, then tap the box.

      Try it

      Give Aina her own user with a home: sudo useradd -m -s /bin/bash aina. Then add her to the kitchen team: sudo usermod -aG kitchen aina.

      You are you in /home/you. 0 things here. Services: cron running, ssh running, nginx running.

      You are hereyou@kedai:~$

      Folder ~

      Empty folder

      + 3 hidden (ls -a)

      Services

      • cronrunningstarts at boot
      • sshrunningstarts at boot
      • nginxrunningstarts at boot

      Check

      Why usermod -aG kitchen, and not just -G kitchen?

      Pick one answer.

      You did it!

      You can now tell users from groups, and use sudo with care.

      Go deeper (optional)

      sudo -i opens a root shell: the prompt ends in # and a root badge shows. Type exit to give the key back. Without sudo, useradd says command not found: admin tools live in /usr/sbin, outside your PATH.

      Real rep (optional): on your own Linux, run id and groups. Then sudo -l shows what sudo lets you do.