World map

 

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 are hereyou@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 boot
  • sshrunningstarts at boot
  • nginxrunningstarts 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 are hereyou@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 boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

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 are hereyou@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 boot
        • sshrunningstarts at boot
        • nginxrunningstarts at boot

        Check

        Good habit, or risky?

        Swipe right for good, left for needs work. Or use the buttons.

        1 / 4chmod 600 secret.txt
        chmod 600 secret.txt

        You 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.