How to do it...

To understand the workings of ACLs, let's follow these steps:

  1. We will first check the default ACL values for any file or directory. To do this, we use the getfacl command:

  1. Now, to set an ACL on file1.txt, we will use the following command:

In the preceding command, we have given rwx access to the root user for the file1.txt file.

When we check again using getfacl, we can see the new ACL values.

  1. Run the given command to confirm ACL setup on file1.txt:

The (+) sign after the file permissions confirms it has the ACL set up.

  1. We can also set an ACL on a folder recursively, by using the setfacl command. First, we will check the default ACL for our dir1 directory, using getfacl:

  1. Now, let's add rwx access to the dir1 directory using setfacl:

  1. We can now confirm that the ACL is set up on the directory using the given command:

  1. Now, let's check the ACL for the user1 group on file1.txt:

  1. Let's set rwx access to the group user1 on file1.txt:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.191.22