Courseiva
EX200Chapter 6 of 20Objective 2.2

File Access Controls and ACLs

File access controls determine who can read, write, or run a file on a Linux system. Without them, any user could delete critical system files or steal private data, which is why the Red Hat EX200 exam tests your ability to set precise permissions using access control lists (ACLs). Mastering ACLs lets you grant fine-grained access to specific users or groups without breaking the existing permission structure.

20 min read
Intermediate
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture File Access Controls and ACLs

The Club Bouncer and the VIP List Analogy

A group of friends wants to get into a busy nightclub, so the bouncer at the door checks who they are. The first problem is that the club has a basic rule: only people over 21 get in. This rule works for most guests, but what if one of your friends is a famous DJ who needs to bring in their own equipment, or a VIP who has a private table upstairs? The basic age rule cannot handle these special cases.

That is when the club manager introduces a VIP list and a clipboard full of special notes. These notes say things like \"DJ Smith can enter through the side door with gear\" or \"Table 7 guests can bring two extra friends.\" The basic rule (over 21) still applies to everyone, but the extra notes on the clipboard override or add to that rule for specific people. In Linux, the basic file permissions (owner, group, others) are like the bouncer's main rule. Access control lists (ACLs) are the clipboard notes that give specific users or groups extra permissions beyond the basic ones, without changing the door policy for everyone else.

How It Actually Works

Linux file permissions are the security system that decides what each user can do with a file or directory. Every file and directory has three sets of permissions, one for the file's owner, one for the group that owns the file, and one for everyone else. These three sets control read (r), write (w), and execute (x) access. This standard model works well when you only need to manage a few users, but in real organisations you often need to give a specific user outside the owning group some extra access, or let multiple groups have different levels of access to the same file.

Access Control Lists, or ACLs, solve this problem by attaching a detailed list of permissions to a file or directory. Instead of just three slots (owner, group, others), ACLs allow you to add entries for any specific user or any specific group. For example, you can give user \"alice\" read and write permissions on a file that her team owns, while user \"bob\" from a different department gets only read permission, all without changing the underlying owner or group. The basic permissions still exist and act as the default, but ACL entries add extra rules.

The two main types of ACLs are access ACLs and default ACLs. Access ACLs control permissions on a specific file or directory. Default ACLs only apply to directories, and they set the starting permissions that any new file or subdirectory created inside that directory will inherit. When you set a default ACL on a directory, every new item created inside it automatically gets those same ACL entries. This is extremely useful for shared project folders where every team member needs consistent access to new files.

To view ACLs, you use the \"getfacl\" command. This command shows you the current ACL entries for a file or directory, including the three standard owner/group/others entries, plus any additional user or group entries. The output shows the exact permissions each entry allows. To set or modify ACLs, you use the \"setfacl\" command. The most common options are:

-m to modify an existing ACL or add a new entry.

-x to remove a specific ACL entry.

-b to remove all ACL entries from a file or directory.

-R to apply changes recursively to all items inside a directory.

-d to set a default ACL on a directory.

When you use setfacl, you specify the type of entry you are adding. For example, \"setfacl -m u:alice:rw file.txt\" gives user alice read and write permissions on file.txt. The pattern is always the letter \"u\" for user, a colon, the username, another colon, and then the permissions in symbolic form (r, w, x). For groups, you use \"g\" instead of \"u\", as in \"setfacl -m g:developers:rx project\". For others (everyone not covered by other entries), you use \"o\".

ACLs introduce the concept of a mask. The mask is a limit that restricts the maximum permissions that any named user or named group can get through ACLs, though it does not affect the file's owner or the others entry. When you set an ACL on a file, the mask is automatically recalculated to be the union of all permissions granted to named users and named groups. You can also set the mask explicitly with \"setfacl -m m::rwx file.txt\". The mask is crucial because it can silently reduce the effective permissions of ACL entries. If the mask only allows read, then even if an ACL entry grants write permission, that write permission will be blocked. Beginners often forget this and cannot understand why an ACL entry seems to be ignored.

Default ACLs work differently. When you set a default ACL on a directory, it does not change the permissions of existing files inside that directory. Instead, it only affects new files and subdirectories created in the future. For example, if you set a default ACL that gives the group \"accounting\" read access, any new file created in that directory will automatically give that group read access. The command to set a default ACL uses the -d flag, like \"setfacl -d -m g:accounting:rx sharedir\".

ACLs replace the need to create many special groups just to manage permissions. Without ACLs, if you wanted to give user \"charlie\" access to a file owned by the \"engineering\" group, you would either have to change the file's group or add charlie to the engineering group, both of which have side effects. ACLs let you grant that access directly without modifying group memberships or ownership. The entire system is managed through extended attributes on the filesystem, which means the filesystem must support ACLs. On Red Hat Enterprise Linux, the default filesystem (XFS) fully supports ACLs out of the box, so you do not need to enable anything.

What This Looks Like on the Job

Imagine you work as a junior system administrator for a medium-sized company that develops software. The company has a shared server where the development team stores project files in a directory called /opt/projects. The directory is owned by the user \"devlead\" and the group \"developers\". The basic permissions are rwx for the owner, rwx for the group, and --- for others, meaning only the devlead user and members of the developers group can access it.

One day, the finance department needs to audit some configuration files stored in a subdirectory called /opt/projects/config. The auditor, whose username is \"auditor\", is not a member of the developers group. You cannot add the auditor to the developers group because that would give them access to all development files, which is a security risk. You also cannot change the owner or group of the config files because that would break automated scripts.

This is where ACLs save the day. You navigate to the /opt/projects directory and run the command \"setfacl -m u:auditor:rx config\". This gives the auditor user read and execute permissions on the config directory and its contents, but does not give them any access to other parts of /opt/projects. The finance department can complete their audit without any security breach.

Later, the development team creates a new shared workspace for a joint project with the quality assurance team. They want every new file created in this workspace to automatically be readable by the QA team. Instead of asking you to modify permissions on each new file, you set a default ACL on the workspace directory:

First, create the directory: \"mkdir /opt/projects/workspace\"

Set ownership: \"chown devlead:developers /opt/projects/workspace\"

Set a default ACL: \"setfacl -d -m g:qateam:rx /opt/projects/workspace\"

Also set an access ACL so the QA team can see existing files: \"setfacl -m g:qateam:rx /opt/projects/workspace\"

Now, every time a developer creates a new file in the workspace directory, the file automatically gets an ACL entry granting read and execute access to the QA group. The developers do not need to remember to change permissions manually. If the QA team later leaves the project, you can remove the ACL entry with \"setfacl -x g:qateam /opt/projects/workspace\" and also \"setfacl -x g:qateam /opt/projects/workspace\" for the default ACL, using the -d flag.

In a real production environment, you might also encounter situations where a script fails because the mask is too restrictive. For example, you grant a user write permission with setfacl, but when they try to edit the file, they get a permission denied error. Checking the mask with \"getfacl\" reveals that the mask entry shows only r-x, even though the user's ACL entry shows rw-. The fix is to explicitly set the mask with \"setfacl -m m::rwx file\" or just reapply the ACL entries, which recalculates the mask automatically. These real-world troubleshooting steps are exactly what the EX200 exam tests.

How EX200 Actually Tests This

The EX200 exam objective 2.2 requires you to demonstrate that you can set and modify file and directory permissions using ACLs. This is a hands-on performance-based task, which means you will be at a terminal with real files and directories, and you must type the correct commands to solve a scenario. The exam does not ask multiple-choice questions about ACL theory. Instead, it gives you a situation and expects you to use setfacl and getfacl correctly.

The most common question type is: \"Configure access so that user X can read and write to file Y without changing the file's ownership or group.\" The correct answer pattern is to use \"setfacl -m u:username:rw filepath\". Many candidates forget that the user identifier inside the ACL entry must be a username, not a UID number, unless the question specifically says to use the numeric ID. Always use the username as shown in the exam environment.

Another frequent trap involves the mask. The exam will set up a file that already has an ACL with a restrictive mask. The question asks you to give a group or user full read/write/execute access. If you just run setfacl -m g:groupname:rwx, the mask will recalculate to rwx, and it will work. But if the mask was set explicitly to something lower, and you do not realise the mask is limiting your new ACL entry, you might think the command succeeded when actually the effective permissions are still restricted. To check effective permissions, run getfacl and look for the comment \"effective: ...\" next to each entry. The exam loves to hide a mask that cancels out your ACL change.

Traps the exam commonly sets include:

You are asked to give a user access to a directory recursively using -R, but the directory already has a default ACL that conflicts with your new entries. The correct approach is to use -R and -m together, but that only modifies access ACLs, not default ACLs. To modify default ACLs recursively, you must use -R -d -m.

You are asked to remove all ACL entries from a file but keep the basic permissions intact. The command is setfacl -b, which removes ACL entries but leaves the owner/group/others permissions untouched. Candidates often mistakenly use setfacl -x or -r, which are wrong.

You are given a directory and told to ensure all future files created inside it inherit a specific ACL entry. The trick is that only default ACLs cause inheritance, not access ACLs. Many candidates apply an access ACL to the directory and assume new files will inherit it, but they will not. You must use setfacl -d -m.

Key definitions to memorise:

ACL: Access Control List, an extended set of permissions beyond the standard owner/group/others.

getfacl: command to display ACLs.

setfacl: command to modify ACLs.

Mask: the maximum permission allowed for named users and groups in an ACL.

Default ACL: ACL entries that are inherited by new files and subdirectories within a directory.

Effective permission: the actual permission after the mask is applied.

You must also know that not all filesystems support ACLs. On Red Hat Enterprise Linux, XFS and ext4 support ACLs by default, but if the exam uses a different filesystem, it will be stated. In practice, the exam uses XFS.

Finally, the exam expects you to verify your work. After setting an ACL, always run getfacl to confirm the entry is correct and the mask is not blocking the intended permissions. This verification step is worth points in the scoring rubric.

Key Takeaways

Access control lists (ACLs) let you grant permissions to specific users or groups without changing the file's owner, group, or the permissions for everyone else.

The setfacl command with the -m flag modifies an existing ACL, while -x removes a specific entry, and -b removes all ACL entries from a file or directory.

The mask in an ACL acts as a maximum permission ceiling for all named users and named groups, and can silently block permissions you thought you granted.

Default ACLs (set with the -d flag) only affect newly created files and subdirectories inside a directory, not existing items.

To apply ACL changes recursively to all existing files and directories, you must use the -R flag with setfacl.

Always verify your ACLs with getfacl after setting them to confirm the mask is not restricting effective permissions and that the entries are correct.

Watch Out for These

Mistake

Setting an ACL on a directory automatically gives those permissions to all existing files inside that directory.

Correct

ACLs on a directory only affect that directory itself. To apply ACLs to existing files inside, you must use the -R (recursive) flag with setfacl. Default ACLs only affect newly created files, not existing ones.

Beginners assume that directory permissions propagate automatically because chmod with -R does propagate Unix permissions, so they naturally think ACLs work the same way.

Mistake

A user setfacl entry always gives exactly the permissions you specify, like chmod does.

Correct

The effective permissions of a user or group ACL entry are limited by the ACL mask. If the mask is set to r--, then even if the user entry says rwx, the user only gets read. The mask acts as a ceiling.

The mask is a unique ACL concept that does not exist in standard Unix permissions. Beginners see the ACL entry show rwx in getfacl output and think it is active, not realising the mask is silently cutting it down.

Mistake

If you remove a user from all groups that own a file, they lose all access even if an ACL grants them access.

Correct

ACL entries are independent of group membership. A user can have full access via an ACL even if they are not in the file's owning group. The ACL is checked after the basic owner/group/others check.

People are used to the idea that file permissions are solely based on ownership and group membership. ACLs break that mental model, so beginners assume groups still control everything.

Mistake

The chmod command overrides or removes ACLs when you use it on a file that has ACL entries.

Correct

Running chmod on a file with ACLs does not remove the ACL entries. It only changes the mask to reflect the new permissions of the group class. The ACL entries themselves persist, though their effective permissions may change due to the updated mask.

Beginners think chmod and ACLs are separate and exclusive systems, but they interact through the mask. Seeing getfacl still show entries after chmod can be confusing.

Mistake

You can give permissions to a group using an ACL entry by typing 'g:groupname:rwx' and it will work even if the group does not exist on the system.

Correct

ACL entries for groups require the group to exist on the system. If the group does not exist, setfacl will still set the entry, but it will be stored with the GID number and may not resolve to a name. This can cause confusion and permission errors.

Linux systems often allow creating references to non-existent users in other contexts (like chown with a numeric ID), so beginners assume ACLs are similarly permissive.

Keep going

You've finished File Access Controls and ACLs. Continue through the EX200 study guide to build a complete picture of the exam.

Done with this chapter?