File permissions
此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
English
Who can do what
- Every file has permissions that say who may read, write, or execute it.
ls -lshows them on the left of each line:
ls -l script.sh
- You see something like
-rwxr-xr-x. Read it in groups of three.
English
Reading the flags
- The ten characters are: type, then owner, group, others:
- rwx r-x r-x
file owner group others
r= read,w= write,x= execute,-= not allowed. So the owner here can do everything; others can read and run.

English
Changing permissions
chmodchanges the mode. Numbers are a quick way:r=4, w=2, x=1, added per group:
chmod 755 script.sh
7= 4+2+1 (rwx) for the owner;5= 4+1 (r-x) for group and others.755is the classic "runnable program".
English
Common mistakes
chmodsets read, write and execute for user, group and others.- On a real system, direct execution such as
./script.shneeds execute permission and a suitable interpreter.sh script.shinstead asks the shell to read the file, so the script itself needs read permission, not its execute bit. Our simulator displays modes but does not execute scripts.
探索
File permissions (chmod)
Owner / group / others each get rwx — the octal is just those bits.
难度 3/5 · 今日首次完成可获 200 金币及少量额外奖励
Make script.sh runnable by giving it permissions 755 with chmod 755 script.sh. The check shows ls -l so you can see the new rwx flags.
难度 3/5 · 今日首次完成可获 200 金币及少量额外奖励
secret.key holds a private key, so ordinary group members and other users should have no read access. Give it permission 600 with chmod 600 secret.key — owner read+write, group and others nothing.
难度 3/5 · 今日首次完成可获 200 金币及少量额外奖励
Share report.txt with your project group. The owner needs read and write; the group needs read only; other users need no access. Choose the numeric mode and set it with chmod.