BM: Baca dalam Bahasa Melayu
World L2: Keys & Staff
Change permissions: chmod
You will learn: to add and take away keys with chmod, with letters and with numbers.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
Two problems in the shop. open.sh cannot run. And secret.txt shows -rw-r--r--: everyone may read the safe code! Which tool fixes keys?
Pick one answer.
Watch
You are you in /home/you/shop. 4 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/shop$Folder ~/shop
- open.sh (file)
-rwxr-xr-xcan run - prices.txt (file)
-rw-r--r-- - secret.txt (file)
-rw-r--r-- - staff/ (folder)
drwxr-x---roster.txt
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
chmod +x open.sh added the run key. chmod means “change mode”. Letters: u owner, g group, o others. + adds, - takes away.
Try it
Build a command: take the read key from group and others on secret.txt.
Tap the pieces in the right order.
Try it
Give open.sh its run key, then run it: chmod +x open.sh, then ./open.sh.
You are you in /home/you/shop. 4 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/shop$Folder ~/shop
- open.sh (file)
-rw-r--r-- - prices.txt (file)
-rw-r--r-- - secret.txt (file)
-rw-r--r-- - staff/ (folder)
drwxr-x---roster.txt
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
./ means “the file right here”.Check
Keys also have numbers: r = 4, w = 2, x = 1. Add them per ring. Sort each into its number.
Drag a card into a box. Or tap the card, then tap the box.
Predict
You type chmod 600 secret.txt. What does ls -l show for it?
Pick one answer.
Try it
Lock the safe code so only you can read and change it: chmod 600 secret.txt.
You are you in /home/you/shop. 4 things here. Services: cron running, ssh running, nginx running.
you@kedai:~/shop$Folder ~/shop
- open.sh (file)
-rw-r--r-- - prices.txt (file)
-rw-r--r-- - secret.txt (file)
-rw-r--r-- - staff/ (folder)
drwxr-x---roster.txt
Services
cronrunningstarts at bootsshrunningstarts at bootnginxrunningstarts at boot
Hint
Letters work too:chmod go-r secret.txt.Check
Good habit, or risky?
Swipe right for good, left for needs work. Or use the buttons.
chmod 600 secret.txtYou did it!
You can now add and take away keys with letters or numbers.
Go deeper (optional)
Common pairs: 644 for files, 755 for scripts and folders, 600 for secrets. chmod -R changes a whole folder tree, so check twice. A script also needs a first line like #!/bin/bash.
Real rep (optional): in a practice folder, touch s.sh, ls -l s.sh, chmod 755 s.sh, then ls -l s.sh again.
Bahasa Melayu
Dua masalah di kedai. open.sh tak boleh berjalan. Dan secret.txt tunjuk -rw-r--r--: semua orang boleh baca kod peti besi! Alat mana yang baiki kunci?
chmod +x open.sh tambah kunci jalan. chmod maksudnya “change mode” (tukar mod). Huruf: u pemilik, g kumpulan, o orang lain. + tambah, - buang.
Bina arahan: buang kunci baca daripada kumpulan dan orang lain pada secret.txt.
Beri open.sh kunci jalan, kemudian jalankannya: chmod +x open.sh, kemudian ./open.sh.
./ maksudnya “fail di sini”.Kunci juga ada nombor: r = 4, w = 2, x = 1. Campurkan bagi setiap gugus. Asingkan ikut nombornya.
Anda taip chmod 600 secret.txt. Apa ls -l tunjuk untuknya?
Kunci kod peti besi supaya hanya anda boleh baca dan ubah: chmod 600 secret.txt.
chmod go-r secret.txt.Tabiat baik, atau berisiko?
Kini anda boleh tambah dan buang kunci dengan huruf atau nombor.
You finished this before. Practice is always welcome!
Official docs: chmod (Debian 13 man page) · GNU coreutils: symbolic modes · GNU coreutils: numeric modes
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?