Using ACLs to access files
Implementing the basic file permissions using chmod
is not enough, so we can use ACLs, or Access Control Lists. In addition to providing permissions for the owner and group for a particular file, we can set permissions for any user, any user group, or a group of all users who are not in the group of the particular user using ACLs.
Getting ready
Before using ACLs, we check whether it is enabled or not:
- To do this, we try to view the ACLs for any file, as shown here:

This command will show an output like this if ACLs are enabled. In our case, they are not enabled for /dev/sda1
, as it is not listed in the mount options.
- To enable an ACL, we will add it to the filesystem, using the following command:

- Now, run the
tune2fs
command again to confirm the ACL is enabled:

Now, we can see the ACLs option in the /dev/sda1
partition.
How to do it...
To understand the workings of ACLs, let's follow these steps:
- We will first check the default ACL values for any file or directory. To do...