Unit 4: File Permissions and Ownership - Practice Quiz

CSE105 — Creative Engineering Workshop 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 In the Linux permission model, permissions are assigned to which three categories of users?

Linux Permission Model Easy
A. Root, System, Public
B. Admin, User, Guest
C. Owner, Group, Others
D. Read, Write, Execute

2 Which permission allows a user to view the contents of a file?

Read, Write and Execute Permissions Easy
A. Read
B. Execute
C. Modify
D. Write

3 Which single letter represents the execute permission in Linux?

Read, Write and Execute Permissions Easy
A. x
B. e
C. r
D. w

4 In numeric (octal) mode, which digit value represents the read permission?

chmod (Symbolic and Numeric Modes) Easy
A. 4
B. 1
C. 2
D. 7

5 What does the command chmod 755 file.txt set for the file owner?

chmod (Symbolic and Numeric Modes) Easy
A. Read and execute only
B. Execute only
C. Read and write only
D. Read, write, and execute

6 What is the primary purpose of the chown command?

chown Command Easy
A. Change the permissions of a file
B. Change the name of a file
C. Change the contents of a file
D. Change the owner of a file

7 What does the umask command control?

umask Command Easy
A. Ownership of existing files
B. Default permissions for new files
C. Encryption of file contents
D. Deletion of protected files

8 Every file in Linux is associated with which two ownership attributes?

File Ownership and Group Ownership Easy
A. A name and an extension
B. A user owner and a group owner
C. A password and a key
D. A size and a timestamp

9 Which permission is required to modify or delete the contents of a file?

Read, Write and Execute Permissions Easy
A. Execute
B. Access
C. Write
D. Read

10 In symbolic mode, which command adds execute permission for the owner?

chmod (Symbolic and Numeric Modes) Easy
A. chmod g+x file
B. chmod a-x file
C. chmod u+x file
D. chmod o+x file

11 In the permission string -rwxr-xr--, what does the first character - indicate?

Linux Permission Model Easy
A. It is a directory
B. It is a symbolic link
C. It is a hidden file
D. It is a regular file

12 What octal value represents read and write permissions combined?

chmod (Symbolic and Numeric Modes) Easy
A. 3
B. 7
C. 5
D. 6

13 Which command changes the owner of data.txt to the user alice?

chown Command Easy
A. chgrp alice data.txt
B. chown alice data.txt
C. chown data.txt alice
D. chmod alice data.txt

14 A common default umask value on many Linux systems is:

umask Command Easy
A. 022
B. 755
C. 777
D. 111

15 Which command is specifically used to change only the group ownership of a file?

File Ownership and Group Ownership Easy
A. chgrp
B. chown
C. groupadd
D. chmod

16 Why is giving 777 permissions to a file generally considered a security risk?

Permission Security Concepts Easy
A. It encrypts the file automatically
B. It removes the file's owner
C. It allows everyone to read, write, and execute
D. It hides the file from all users

17 How many permission bits (r, w, x) are shown for each of the three user categories?

Linux Permission Model Easy
A. 4
B. 1
C. 2
D. 3

18 In symbolic mode, what does the letter a stand for in chmod a+r file?

chmod (Symbolic and Numeric Modes) Easy
A. All users
B. Administrator
C. Anonymous
D. Author

19 Which principle recommends granting users only the minimum permissions they need?

Permission Security Concepts Easy
A. Principle of open permissions
B. Principle of least privilege
C. Principle of shared ownership
D. Principle of full access

20 For a directory, which permission allows a user to enter it using cd?

Read, Write and Execute Permissions Easy
A. Execute
B. Read
C. List
D. Write

21 A file listing shows -rwxr-xr--. Which set of users has permission to modify the contents of this file?

Linux Permission Model Medium
A. Owner and group
B. Only the group
C. Owner, group, and others
D. Only the owner

22 For a directory, what does the execute (x) permission actually grant?

Read, Write and Execute Permissions Medium
A. The ability to enter the directory and access its files
B. The ability to list the directory contents
C. The ability to run the directory as a program
D. The ability to delete the directory

23 Which numeric mode is equivalent to the symbolic permission rw-r--r--?

chmod (Symbolic and Numeric Modes) Medium
A. 744
B. 755
C. 664
D. 644

24 A file has mode 600. Which command adds read and execute permission for the group without altering the owner's permissions?

chmod (Symbolic and Numeric Modes) Medium
A. chmod o+rx file
B. chmod g+rx file
C. chmod 655 file
D. 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 Command Medium
A. chown alice report.txt staff
B. chown alice:staff report.txt
C. chown alice.staff:report.txt
D. 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?

umask Command Medium
A. 644
B. 666
C. 022
D. 755

27 With a umask of 027, what default permissions will a newly created directory receive?

umask Command Medium
A. 750
B. 027
C. 640
D. 755

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?

File Ownership and Group Ownership Medium
A. Read and write to the file
B. Execute the file
C. Read the file but not write to it
D. Neither read nor write

29 Why is assigning chmod 777 to a file generally considered a security risk?

Permission Security Concepts Medium
A. It prevents the file from being deleted
B. It removes the file's owner entirely
C. It hides the file from other users
D. It allows any user to read, modify, and execute the file

30 What is the effect of the command chmod a-w file.txt?

chmod (Symbolic and Numeric Modes) Medium
A. Removes write permission from owner, group, and others
B. Adds write permission for all classes
C. Removes all permissions from the file
D. Removes write permission only from others

31 In the permission string drwxr-x---, what does the leading d indicate?

Linux Permission Model Medium
A. The file is a device
B. The entry is a directory
C. Deletion is disabled
D. The file is a duplicate

32 Which command recursively changes ownership of all files inside /var/www to user web?

chown Command Medium
A. chown --files web /var/www
B. chown web /var/www
C. chown -r web /var/www*
D. 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?

Read, Write and Execute Permissions Medium
A. Yes, because deletion depends on directory write permission
B. No, because the file lacks write permission
C. No, because the file lacks execute permission
D. Yes, but only if they own the file

34 Which numeric mode grants the owner full permissions, the group read and execute, and others execute only?

chmod (Symbolic and Numeric Modes) Medium
A. 775
B. 715
C. 751
D. 754

35 A colleague wants newly created files to be readable and writable only by the owner (mode 600). Which umask achieves this?

umask Command Medium
A. 066
B. 022
C. 177
D. 077

36 The principle of least privilege applied to file permissions suggests you should:

Permission Security Concepts Medium
A. Assign every file to the root user
B. Grant only the minimum permissions each user actually needs
C. Use identical permissions on all files
D. Grant full permissions to avoid access errors

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?

File Ownership and Group Ownership Medium
A. chmod g file
B. chgrp groupname file
C. usermod file groupname
D. chown :groupname file (requires root)

38 Starting from mode 755, what mode results after running chmod g-x,o-rx file?

chmod (Symbolic and Numeric Modes) Medium
A. 700
B. 740
C. 744
D. 754

39 When multiple permission classes could apply, which class does Linux use to check access for a user who owns the file?

Linux Permission Model Medium
A. The owner (user) permissions only
B. The most permissive of all classes
C. The combination of owner and group
D. The group permissions

40 A shell script needs to be run by its owner but should never be modified by anyone. Which mode best fits this requirement?

Permission Security Concepts Medium
A. 755
B. 500
C. 555
D. 700

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 (Symbolic and Numeric Modes) Hard
A. chmod u+x,g+x script.sh
B. chmod a+x script.sh
C. chmod ug+x script.sh
D. chmod +x script.sh

42 The numeric mode 4755 is applied to an executable. What is the security significance of the leading 4?

chmod (Symbolic and Numeric Modes) Hard
A. It grants an extra read permission to the owner beyond rwx
B. It sets the sticky bit, preventing deletion by non-owners
C. It sets the SUID bit, so the program runs with the file owner's privileges
D. It sets the SGID bit, so the program runs with the file group's privileges

43 With umask 027, what permissions will a newly created regular file receive (assuming default base of 666)?

umask Command Hard
A. -rwxr-x--- (750)
B. -rw-r--r-- (644)
C. -rw-rw---- (660)
D. -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?

umask Command Hard
A. 644 — both use base 666
B. 755 — directories use base 777, files use base 666
C. 777 — umask does not apply to directories
D. 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?

Permission Security Concepts Hard
A. The 000 file permission means anyone can delete it
B. Delete permission depends on write+execute on the parent directory, not the file itself
C. Bob must have SUID rights on the file
D. The sticky bit was set, granting delete access

46 The /tmp directory typically has permissions drwxrwxrwt. What does the trailing t accomplish in a world-writable directory?

Permission Security Concepts Hard
A. Only a file's owner (or root) can delete or rename that file, despite world write
B. It makes all files inside inherit the directory's group
C. It causes programs run from /tmp to execute as root
D. It prevents new files from being created by non-owners

47 As root, which command changes ownership of data/ and everything inside it to user alice and group dev, in one recursive invocation?

chown Command Hard
A. chown -R alice:dev data/
B. chown alice:dev -r data/
C. chown -R alice.dev data/ --group
D. 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 Command Hard
A. On Linux, only root may give away ownership of a file to another user
B. chown cannot change owner without also specifying a group
C. Ownership can only be changed with numeric UIDs, not names
D. She must first remove write permission before transferring ownership

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?

Read, Write and Execute Permissions Hard
A. Both list and delete files freely
B. Access app.log by exact name (if file perms allow), but cannot list directory contents
C. List all files but cannot open any of them
D. Neither list nor access any file in the directory

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?

Read, Write and Execute Permissions Hard
A. The file must be executable before it can be written
B. The read bit blocks all writes for the owner
C. Group permissions always override owner permissions
D. Permission checks stop at the owner class since alice matches it, ignoring group bits

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?

Linux Permission Model Hard
A. Only the owner (user) class permissions apply
B. The group permissions apply because they are checked last
C. The most permissive of owner and group applies
D. The union of owner and group permissions applies

52 You run chmod 1770 shared/ on a directory owned by group team. What combined effect does this produce?

chmod (Symbolic and Numeric Modes) Hard
A. SGID set; owner has full access; group and others have none
B. SUID set; owner and group have full access; others have none
C. Sticky bit set; owner and group have full access; others have none
D. Sticky bit set; everyone has full access

53 The symbolic command chmod g=u file is applied to a file with mode 754. What is the resulting numeric mode?

chmod (Symbolic and Numeric Modes) Hard
A. 744
B. 755
C. 754
D. 774

54 Why is setting the SUID bit on a shell script (e.g., a .sh file) generally ineffective on modern Linux systems?

Permission Security Concepts Hard
A. The SUID bit is automatically cleared whenever a script is edited
B. SUID only works on directories, not files
C. The kernel ignores SUID on interpreted scripts to prevent interpreter-based privilege escalation
D. Shell scripts cannot have any special permission bits set

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?

File Ownership and Group Ownership Hard
A. The group of the project/ directory, not the user's primary group
B. The root group by default
C. No group until explicitly assigned with chgrp
D. The user's primary group, ignoring the directory

56 A developer wants newly created files to be -rw------- (600) and directories -rwx------ (700). Which umask achieves this?

umask Command Hard
A. 066
B. 077
C. 177
D. 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?

Linux Permission Model Hard
A. The file is a symbolic link owned by root
B. SUID is set AND the owner still has execute permission (lowercase s)
C. SUID is set but the owner lacks execute permission (would show uppercase S)
D. The owner has read but not execute permission

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?

File Ownership and Group Ownership Hard
A. Yes — but only after running newgrp finance first
B. No — supplementary groups only affect newly created files
C. Yes — supplementary group membership grants the group permissions
D. No — only the primary group is considered for permission checks

59 Which chown invocation changes only the group of file.txt to admins, leaving the owner unchanged?

chown Command Hard
A. chown :admins file.txt
B. chown -g admins file.txt
C. chown admins file.txt
D. chown admins: file.txt

60 A user has read (r) but not execute (x) permission on a directory. What is the practical consequence?

Read, Write and Execute Permissions Hard
A. They cannot even see that the directory exists
B. They can access files by name but cannot list them
C. They can list file names (ls) but cannot access any file's contents or metadata
D. They have full access to all files inside