User permissions: read, write and execute

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

User permissions: read, write and execute

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement best describes a permission?
A A rule that lets an account read, write or execute a file or resource
B A program that scans files for viruses
2. A student has read-only access to a shared class folder. What can they do?
A Open and view the files but not change them
B Edit and delete any file in the folder
3. Which permission lets an account change or delete the data in a file?
A Read
B Write
4. Which permission is needed to run a file as a program?
A Execute
B Read
5. A school gives students read access to the exam results spreadsheet. Is this a safe choice if the aim is to stop students changing marks?
A No, because read access lets students edit marks
B Yes, because read access does not allow changes

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1r-- Ar-- is read-only, so the student can only view the file. To edit their answers they need write permission (rw-).
2rwx BFull permissions: the account can read the file, write to it (change or delete it) and execute it as a program.
3Execute permission lets an account run a file as a program, but does not let it change the file. CRead-only permission: the account can view the file but cannot change, delete or run it.
4Write permission lets an account change or delete data, so it should only be given when needed. DGiving everyone read, write and execute lets anyone change, delete or run the file. Most users should only get r-- (read-only), or no access at all.
5Give a student r-- on a shared file so they can edit their answers E-w-
6Give every user rwx on the school's payroll file F--x

Definitions

permission

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
chmod +_ game.sh
2.
chmod u+_ notes.txt
3.
chmod a=_ report.txt
4.
_____ +x backup.sh
5.
-rw_r-xr-x 1 sam backup.sh

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A file = marks.txt
B user = student
C permission = write
D # student can only view the file
Question 2
A ls -l notes.txt
B -r--r--r-- 1 sam notes.txt
C # owner can read and write
Question 3
A # script that clears temp files
B file = clean.sh
C user = admin
D permission = read
E # admin can run the program
Question 4
A file = diary.txt
B permission = read
C # user can edit and add entries
Question 5
A file = photo.jpg
B guest: write
C owner: read, write
D # guest can view, not delete

Answer Key

User permissions: read, write and execute
Section A: Quick Questions
Q1
A — A rule that lets an account read, write or execute a file or resource
Q2
A — Open and view the files but not change them
Q3
B — Write
Q4
A — Execute
Q5
B — Yes, because read access does not allow changes
Section B: Match the Pairs
Q1
r-- → Read-only permission: the account can view the file but cannot change, delete or run it.
Q2
rwx → Full permissions: the account can read the file, write to it (change or delete it) and execute it as a program.
Q3
Execute permission lets an account run a file as a program, but does not let it change the file. → --x
Q4
Write permission lets an account change or delete data, so it should only be given when needed. → -w-
Q5
Give a student r-- on a shared file so they can edit their answers → r-- is read-only, so the student can only view the file. To edit their answers they need write permission (rw-).
Q6
Give every user rwx on the school's payroll file → Giving everyone read, write and execute lets anyone change, delete or run the file. Most users should only get r-- (read-only), or no access at all.
Section C: Definitions
Q1
permission — A rule that lets an account read, write or execute a file or resource. Read only views it, write can change or delete it, and execute runs it as a program.
Section D: Fill in the Blanks
Q1
chmod +x game.sh
Q2
chmod u+w notes.txt
Q3
chmod a=r report.txt
Q4
chmod +x backup.sh
Q5
-rwxr-xr-x 1 sam backup.sh
Section E: Spot the Error
Q1
C — The comment says the student can only view the file, so they need read permission. Write permission would let them change or delete the marks. It should be permission = read.
Q2
B — The first group of letters is the owner's permissions. -r-- gives the owner read only. For the owner to read and write it must be rw-, as in -rw-r--r--.
Q3
D — Read permission only lets the admin view the script. To run it as a program they need execute permission. It should be permission = execute.
Q4
B — Read permission only lets the user look at the diary. Editing and adding entries needs write permission. It should be permission = write.
Q5
B — Write permission lets someone change or delete data. The guest should only view the photo, so the rule should be guest: read.