Unit 4: File Permissions and Ownership - Practice Quiz
1 In the Linux permission model, permissions are assigned to which three categories of users?
2 Which permission allows a user to view the contents of a file?
3 Which single letter represents the execute permission in Linux?
4 In numeric (octal) mode, which digit value represents the read permission?
5
What does the command chmod 755 file.txt set for the file owner?
6
What is the primary purpose of the chown command?
7
What does the umask command control?
8 Every file in Linux is associated with which two ownership attributes?
9 Which permission is required to modify or delete the contents of a file?
10 In symbolic mode, which command adds execute permission for the owner?
chmod g+x file
chmod a-x file
chmod u+x file
chmod o+x file
11
In the permission string -rwxr-xr--, what does the first character - indicate?
12 What octal value represents read and write permissions combined?
13
Which command changes the owner of data.txt to the user alice?
chgrp alice data.txt
chown alice data.txt
chown data.txt alice
chmod alice data.txt
14 A common default umask value on many Linux systems is:
15 Which command is specifically used to change only the group ownership of a file?
chgrp
chown
groupadd
chmod
16
Why is giving 777 permissions to a file generally considered a security risk?
17 How many permission bits (r, w, x) are shown for each of the three user categories?
18
In symbolic mode, what does the letter a stand for in chmod a+r file?
19 Which principle recommends granting users only the minimum permissions they need?
20
For a directory, which permission allows a user to enter it using cd?
21
A file listing shows -rwxr-xr--. Which set of users has permission to modify the contents of this file?
22
For a directory, what does the execute (x) permission actually grant?
23
Which numeric mode is equivalent to the symbolic permission rw-r--r--?
24
A file has mode 600. Which command adds read and execute permission for the group without altering the owner's permissions?
chmod o+rx file
chmod g+rx file
chmod 655 file
chmod g=rwx file
25
Which command changes both the owner to alice and the group to staff for report.txt in a single invocation?
chown alice report.txt staff
chown alice:staff report.txt
chown alice.staff:report.txt
chown -g staff -u alice report.txt
26
If the umask is set to 022, what will be the default permission of a newly created regular file?
27
With a umask of 027, what default permissions will a newly created directory receive?
28
A user bob is not the owner of data.log but belongs to its group. The file mode is 640. What can bob do?
29
Why is assigning chmod 777 to a file generally considered a security risk?
30
What is the effect of the command chmod a-w file.txt?
31
In the permission string drwxr-x---, what does the leading d indicate?
32
Which command recursively changes ownership of all files inside /var/www to user web?
chown --files web /var/www
chown web /var/www
chown -r web /var/www*
chown -R web /var/www
33 A user has write permission on a directory but only read permission on a file inside it. Can the user delete that file?
34 Which numeric mode grants the owner full permissions, the group read and execute, and others execute only?
35
A colleague wants newly created files to be readable and writable only by the owner (mode 600). Which umask achieves this?
36 The principle of least privilege applied to file permissions suggests you should:
37 Which command can a regular (non-root) user use to change only the group of a file they own to a group they belong to?
chmod g file
chgrp groupname file
usermod file groupname
chown :groupname file (requires root)
38
Starting from mode 755, what mode results after running chmod g-x,o-rx file?
39 When multiple permission classes could apply, which class does Linux use to check access for a user who owns the file?
40 A shell script needs to be run by its owner but should never be modified by anyone. Which mode best fits this requirement?
41
A file script.sh currently has permissions -rw-r--r--. Which single chmod command sets it to -rwxr-xr-- using symbolic mode without affecting the read bits already present?
chmod u+x,g+x script.sh
chmod a+x script.sh
chmod ug+x script.sh
chmod +x script.sh
42
The numeric mode 4755 is applied to an executable. What is the security significance of the leading 4?
rwx
43
With umask 027, what permissions will a newly created regular file receive (assuming default base of 666)?
-rwxr-x--- (750)
-rw-r--r-- (644)
-rw-rw---- (660)
-rw-r----- (640)
44
A directory is created while umask is 022. What are the resulting directory permissions, and why do they differ from a file created under the same umask?
644 — both use base 666
755 — directories use base 777, files use base 666
777 — umask does not apply to directories
755 — directories add execute automatically after umask
45
A directory has permissions -rwxr-xr-x and contains a file secret.txt with ---------- (000). User bob, who is not the owner and not in the group, is able to delete secret.txt. What best explains this?
46
The /tmp directory typically has permissions drwxrwxrwt. What does the trailing t accomplish in a world-writable directory?
/tmp to execute as root
47
As root, which command changes ownership of data/ and everything inside it to user alice and group dev, in one recursive invocation?
chown -R alice:dev data/
chown alice:dev -r data/
chown -R alice.dev data/ --group
chown --recursive alice dev data/
48
A non-root user alice owns report.txt. She runs chown bob report.txt and it fails with 'Operation not permitted'. Why?
chown cannot change owner without also specifying a group
49
A directory logs/ has permissions d--x--x--x (111). A user knows a file is named app.log inside it. What can that user do?
app.log by exact name (if file perms allow), but cannot list directory contents
50
A file has permissions -r--rw-r--. The owner alice wants to append data to it but cannot. Meanwhile group members can write. Why can't the owner write?
51 In the permission model, the three-class hierarchy (user, group, other) is checked in a specific order. If a user is both the file owner AND a member of the file's group, which permissions apply?
52
You run chmod 1770 shared/ on a directory owned by group team. What combined effect does this produce?
53
The symbolic command chmod g=u file is applied to a file with mode 754. What is the resulting numeric mode?
744
755
754
774
54
Why is setting the SUID bit on a shell script (e.g., a .sh file) generally ineffective on modern Linux systems?
55
The SGID bit is set on a directory project/ (drwxrwsr-x). A user creates a new file inside it. What group does the new file receive?
project/ directory, not the user's primary group
root group by default
chgrp
56
A developer wants newly created files to be -rw------- (600) and directories -rwx------ (700). Which umask achieves this?
066
077
177
700
57
In the output -rwsr-xr-x, the s appears in the owner's execute position. What does this indicate about the owner's execute permission itself?
s)
S)
58
A user carol belongs to groups staff (primary) and finance (supplementary). A file is owned by group finance with mode -rw-rw----. Can carol write to it?
newgrp finance first
59
Which chown invocation changes only the group of file.txt to admins, leaving the owner unchanged?
chown :admins file.txt
chown -g admins file.txt
chown admins file.txt
chown admins: file.txt
60
A user has read (r) but not execute (x) permission on a directory. What is the practical consequence?
ls) but cannot access any file's contents or metadata
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →