Objectives
What the exam tests
- Create, mount, unmount, and use VFAT, ext4, and XFS filesystems
- Mount and unmount network filesystems using NFS
- Configure automounting with autofs
- Extend existing logical volumes and filesystems
- Create and configure set-GID directories for collaboration
- Diagnose and correct file permission problems
- List and set file ACLs
- Configure disk compression and deduplication — VDO (optional)
- Configure group-managed shared directories
- Manage file attributes with
chattrandlsattr
ACLs and special permission bits (especially SGID on shared directories) are tested together in realistic multi-user collaboration scenarios. Expect at least one task combining both.
Coverage weight by topic
Standard file permissions
Understanding the permission model
Every file and directory has three permission sets — owner (u), group (g), and others (o) — each with read (r=4), write (w=2), and execute (x=1) bits.
| Symbol | Octal | On a file | On a directory |
|---|---|---|---|
r | 4 | Read file contents | List directory (ls) |
w | 2 | Modify / overwrite file | Create, rename, delete files inside |
x | 1 | Execute as program | Enter with cd; traverse path |
- | 0 | Permission not granted | Permission not granted |
chmod — symbolic and octal modes
chown and chgrp
Only root can change file ownership. Regular users can only change a file's group to a group they belong to.
umask — default permission mask
| umask | New file | New directory | Common use |
|---|---|---|---|
0022 | 644 rw-r--r-- | 755 rwxr-xr-x | System default — public readable |
0027 | 640 rw-r----- | 750 rwxr-x--- | Group-accessible, others blocked |
0002 | 664 rw-rw-r-- | 775 rwxrwxr-x | Collaborative group work |
0077 | 600 rw------- | 700 rwx------ | Maximum privacy |
File attributes — chattr and lsattr
The +i (immutable) flag prevents even root from deleting or modifying a file. If a file seems undeletable, check lsattr first.
Access Control Lists
Why ACLs? Standard permissions are not enough
Standard Unix permissions allow exactly three permission sets: owner, one group, and everyone else. ACLs extend this by letting you grant different permissions to multiple specific users and groups on the same file.
Standard permissions — limitation
- One owner, one group, others
- Cannot give bob rw- and carol r-- separately
- Cannot give a second group different rights
- Stored in inode — no extra packages
ACLs — extended control
- Multiple named users and groups
- Bob gets rw-, carol gets r--, dave gets ---
- Multiple groups with different permissions
- Requires filesystem to be mounted with ACL support (default on RHEL 9)
When ls -l shows a + at the end of the permission string (e.g., rw-r--r--+), an ACL is present. Use getfacl to see the full ACL.
getfacl — reading ACLs
setfacl — setting ACLs
The ACL mask
The mask is the maximum effective permission for all named users, named groups, and the owning group. It does not limit the file owner or "other".
Running chmod on a file with ACLs modifies the mask, not the named ACL entries. This can silently reduce effective permissions. Always verify with getfacl after chmod.
Copying and archiving with ACLs
Standard cp without --preserve=all drops ACLs. Always use cp -a or cp --preserve=all when the destination must keep ACL entries.
Special permission bits
SUID, SGID, and sticky bit overview
| Bit | Octal | On a file | On a directory | ls -l shows |
|---|---|---|---|---|
| SUID | 4xxx | Runs with owner's UID (e.g., /usr/bin/passwd) | No standard effect | s in owner execute position (rws) |
| SGID | 2xxx | Runs with group's GID | New files inherit directory's group; critical for collaboration | s in group execute position (rwxrws) |
| Sticky | 1xxx | No modern effect on files | Only owner or root can delete files in the directory | t in others execute position (rwxrwxt) |
Uppercase S or T in ls -l means the special bit is set but the underlying execute bit is not set — an unusual and often unintentional configuration.
SGID shared directories — exam favourite
The most commonly tested special bit scenario: a shared collaboration directory where all new files automatically belong to the group, not the creating user's primary group.
SGID on a directory is a sign in ls -l: look for s in the group execute position (drwxrws---). Any file created inside will be owned by group devs, not the user's default group.
Sticky bit — shared writable directories
Sticky bit is tested most often in the context of a world-writable shared drop directory where users should not be able to delete each other's files.
SUID on executables
NFS network filesystems
NFS client — mounting network shares
| NFS option | Effect |
|---|---|
rw / ro | Read-write or read-only mount |
sync | Writes confirmed before returning — slower but safe |
async | Writes buffered — faster but risk on crash |
soft | Return error after retries — client application can handle |
hard | Keep retrying forever — safer for important data (default) |
_netdev | Wait for network before mounting — required for NFS in fstab |
nfsvers=4 | Force specific NFS version |
timeo= | Timeout in tenths of a second before retrying |
Always include _netdev in /etc/fstab for NFS entries. Without it, the system may hang at boot trying to mount a network share before the network is available.
NFS server — configuring exports
| Export option | Effect |
|---|---|
rw | Allow read-write access from client |
ro | Allow read-only access (default) |
sync | Write to disk before acknowledging client |
no_root_squash | Root on client maps to root on server — use carefully |
root_squash | Root on client maps to anonymous UID (default, safer) |
no_all_squash | Preserve user UIDs (default) |
all_squash | Map all users to anonymous UID |
autofs — automounting
What is autofs?
autofs automatically mounts a filesystem when a process accesses the mount point directory, and unmounts it after a configurable idle timeout (default 5 minutes). This avoids keeping NFS mounts active when not in use and prevents boot-time hangs on unreachable servers.
Static NFS mount (/etc/fstab)
- Mounted at boot, always active
- Boot fails if server unreachable
- Consumes resources even when idle
- Simple to configure
autofs automount
- Mounted on demand, unmounted when idle
- Boot succeeds even if server is down
- No resource use when idle
- Requires autofs service and config files
autofs configuration files
autofs uses two levels of configuration: the master map at /etc/auto.master (or /etc/auto.master.d/) and indirect maps that define specific mount entries.
autofs for user home directories
A very common exam scenario: automount user home directories from an NFS server using the & wildcard key.
The * wildcard key combined with & (substitution) in the map value is the standard pattern for automounting per-user home directories.
Starting and managing autofs
Direct maps vs indirect maps
Indirect map (most common)
- Mount point is a subdirectory below the map base
- Base dir (
/mnt/nfs) managed by autofs - Keys become subdirectories:
/mnt/nfs/data - Use for multiple mounts under one path
- Wildcard
*key supported
Direct map
- Each key is an absolute path
- Mounts appear at exact specified paths
- Use
/-as master map base - Good for one-off mounts at fixed paths
- No wildcard support
Cheat sheet
Most-tested commands — quick reference
chmod u+x script.shchmod 755 script.shchown user:grp fileumaskumask 002chattr +i file.txtlsattr file.txtgetfacl file.txtsetfacl -m u:bob:rw filesetfacl -m g:ops:r filesetfacl -d -m g:devs:rwx /dirsetfacl -x u:bob filesetfacl -b filesetfacl -R -m g:devs:rwx /dirchmod g+s /sharedchmod 2770 /sharedchmod +t /shared/uploadschmod 1777 /tmp/sharedshowmount -e fileservermount -t nfs server:/path /mntserver:/path /mnt nfs defaults,_netdev 0 0dnf install -y autofssystemctl enable --now autofssystemctl reload autofsfind / -perm -4000 -type fcp -a src/ dst/setfacl flag reference
| Flag | Meaning | Example |
|---|---|---|
-m | Modify — add or update an entry | setfacl -m u:bob:rw file |
-x | Remove a specific entry | setfacl -x u:bob file |
-b | Remove all ACL entries | setfacl -b file |
-k | Remove default ACL only | setfacl -k /dir |
-d | Set a default ACL (new files inherit) | setfacl -d -m g:devs:rwx /dir |
-R | Apply recursively | setfacl -R -m g:ops:r /dir |
-n | Do not recalculate mask | setfacl -n -m u:bob:rw file |
autofs configuration summary
| File | Role | Format |
|---|---|---|
/etc/auto.master | Master map — lists base mount points and their map files | /base-dir /etc/map-file [options] |
/etc/auto.master.d/*.autofs | Drop-in master map files (preferred in RHEL 9) | Same as auto.master format |
/etc/auto.NAME | Indirect map — keys become subdirectories under base | key [options] server:/path |
/- /etc/auto.direct | Direct map — keys are absolute paths | /full/path [options] server:/path |
SGID shared directory — exam template
Practice quiz
Question 1 of 8
After running ls -l report.txt you see -rw-r--r--+. What does the + at the end indicate?
+ at the end of the permission string in ls -l output means the file has an Access Control List (ACL). Use getfacl report.txt to view the full ACL. A . at the end indicates an SELinux context but no ACL.Question 2 of 8
You want user bob to have read-write access to /project/data.txt, but the file's group ownership should not change. Which command achieves this?
setfacl -m u:bob:rw grants bob read-write via a named user ACL entry without changing group ownership or affecting other users' permissions. Option A grants rw to everyone (others), which is too broad. Option C changes ownership, not just access. Option D adds bob to a group but doesn't directly control this file's access.Question 3 of 8
A directory /shared has SGID set. User alice (primary group: alice, secondary group: devs) creates a file inside. What group will own the new file?
Question 4 of 8
Which command sets a default ACL on /project so that any new files created inside automatically grant group devs read-write-execute permission?
-d flag sets a default ACL on a directory. Default ACLs are inherited by new files and subdirectories created inside. Option A sets a regular ACL on the directory itself but does not affect newly created files. Option C removes an entry. Option D removes default ACLs (-k) then tries to modify — invalid combination.Question 5 of 8
You need to persistently mount the NFS share fileserver:/exports/data at /mnt/data. Which /etc/fstab entry is correct?
_netdev to delay mounting until the network is available. Without it, boot can hang on an unreachable NFS server. Option A is missing _netdev. Option C has device and mountpoint swapped. Option D uses ext4 as filesystem type — NFS mounts must use nfs.Question 6 of 8
In an autofs indirect map, the entry * -rw,sync fileserver:/home/& is used. What does the & represent?
& is a substitution token that expands to whatever matched the key (* wildcard) in that entry. If user alice accesses the automounted directory, & becomes alice, so autofs mounts fileserver:/home/alice. This is the standard pattern for per-user home directory automounting.Question 7 of 8
You run setfacl -m u:bob:rwx file.txt but then check with getfacl and see user:bob:rwx #effective:r--. Why is bob's effective permission only r--?
r--, even though bob has rwx in his ACL entry, his effective permission is r-- (masked to read-only). Fix: setfacl -m mask::rwx file.txt to open the mask. This often happens when chmod is run after setting ACLs.Question 8 of 8
A user complains they cannot delete their own file in /shared/uploads even though the directory is world-writable (777). What is the most likely cause?
chattr +i (immutable attribute) on the file itself — which prevents deletion even by the owner. Check with lsattr. Note: if the question had said "cannot delete other users' files", sticky bit would be the answer.