LFCS Certification Filesystem Permissions and ACLs 4 — Questions and Answers
Question 1: What is the effect of 'chmod 4755 /usr/local/bin/mytool'?
- Sets setuid bit plus rwxr-xr-x permissions (Correct answer)
- Sets sticky bit plus rwxr-xr-x permissions
- Sets setgid bit plus rwxr-xr-x permissions
- Sets all special bits plus rwxr-xr-x permissions
Correct answer: Sets setuid bit plus rwxr-xr-x permissions
A leading 4 in the octal notation sets the setuid bit; 755 gives rwxr-xr-x, resulting in -rwsr-xr-x.
Question 2: Which filesystem must be mounted with ACL support enabled for setfacl to work on ext4?
- ACL support is compiled into ext4 by default on most modern Linux distros and no special mount option is needed (Correct answer)
- The 'acl' mount option must always be manually added in /etc/fstab
- ext4 does not support ACLs; you must use XFS
- The filesystem must be mounted with 'user_xattr' option
Correct answer: ACL support is compiled into ext4 by default on most modern Linux distros and no special mount option is needed
On modern Linux kernels, ext4 has ACL support built in and enabled by default without requiring an explicit 'acl' mount option.
Question 3: A directory 'shared' has setgid set. A user creates 'newfile.txt' inside it. What group owns 'newfile.txt'?
- The group of the 'shared' directory (Correct answer)
- The primary group of the creating user
- Root
- The group of the parent directory's parent
Correct answer: The group of the 'shared' directory
The setgid bit on a directory causes new files created inside to inherit the directory's group ownership rather than the creator's primary group.
Question 4: How do you view only the default ACL entries of a directory 'projdir'?
- getfacl projdir | grep default (Correct answer)
- setfacl -d projdir
- getfacl -d projdir
- acl --defaults projdir
Correct answer: getfacl projdir | grep default
Piping getfacl output through grep for 'default' filters out only the default ACL lines from the full ACL listing.
Question 5: What does 'chmod o-wx file.txt' accomplish?
- Removes write and execute from others (Correct answer)
- Removes write and execute from the owner
- Adds write and execute for others
- Removes all permissions from others
Correct answer: Removes write and execute from others
o refers to others (world), and -wx removes write and execute bits from that category.
Question 6: When using ACLs, the 'mask' entry controls effective permissions for which principals?
- Named users (except owner), named groups, and the owning group (Correct answer)
- Only named users
- The file owner and root only
- All users including the owner
Correct answer: Named users (except owner), named groups, and the owning group
The ACL mask defines the maximum effective permissions for named users (except owner), named groups, and the owning group entry.
Question 7: A file has permissions '-rw-rw-r--' and has an ACL. The mask entry is 'rw-'. User 'carol' has ACL entry 'rwx'. What is carol's effective permission?
- rw- (Correct answer)
- rwx
- r--
- ---
Correct answer: rw-
Carol's ACL entry (rwx) is ANDed with the mask (rw-), resulting in effective permissions of rw- (read and write only).
What is the effect of 'chmod 4755 /usr/local/bin/mytool'?