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@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts 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@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
sudo goes in front of the command.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@kedai:~$Folder ~
Empty folder
+ 3 hidden (ls -a)
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
-m makes her home folder. -aG adds a group.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.
Bahasa Melayu
Aina mula kerja di dapur esok. Dia pun perlu guna server. Patutkah dia log masuk sebagai anda?
Anda ialah user (pengguna) you, nombor pekerja 1000. Anda ahli dua pasukan, dipanggil groups (kumpulan): you dan sudo.
/etc/shadow simpan setiap kata laluan, dalam bentuk bercelaru. Anda taip cat /etc/shadow. Apa jadi?
Pasukan sudo boleh pinjam kunci induk untuk satu arahan. Cuba: sudo whoami.
sudo diletak di depan arahan.Kebanyakan kerja tak perlu kunci induk. Yang mana perlu?
Beri Aina pengguna sendiri dengan rumah: sudo useradd -m -s /bin/bash aina. Kemudian masukkan dia ke pasukan dapur: sudo usermod -aG kitchen aina.
-m buat folder rumahnya. -aG tambah kumpulan.Kenapa usermod -aG kitchen, bukan -G kitchen sahaja?
Kini anda boleh bezakan pengguna dan kumpulan, dan guna sudo dengan cermat.
You finished this before. Practice is always welcome!
Official docs: sudo (Debian 13 man page) · useradd (Debian 13 man page) · usermod (Debian 13 man page) · id (Debian 13 man page) · Debian Reference: user accounts
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?