Read Access Control Lists
- ACLs are layered on top of Linux permissions.
- Can’t use standard tools such as
lsto list those.
- Can’t use standard tools such as
- An example:
mkdir aclexercisetouch aclfile- To read the ACLs on the file, we would use the
getfaclcommand.- Installed by default on CentOS.
getfacl aclfile
- For example, you would see a similar output to this:
`getfacl temp
file: temp
owner: howard
group: howard
user::rw- group::r– other::r–
- Installed by default on CentOS.
- Lists the standard Linux permissons.
- Can list the same permissions in tabular format.
- Easier to see which permissions belong to each user.
getfacl -t aclfile`getfacl -t tempfile: temp
USER howard rw- GROUP howard r– other r–`
- Can set ACLs using
setfacl.setfacl -m user:root:rwx aclfile- The
-mis for modify. - The
usernamehere would beroot. - Then the permissions come after that, which in this case is
rwx.- Sets an ACL for a
rootuser.
- Sets an ACL for a
- The
- Then the file would look something like this:
`getfacl -t temp
file: temp
USER howard rw- user root rwx GROUP howard r– mask rwx other r–`
- Will see on CentOs that the permissions of the file will now look like
-rw-rwxr--+, notice the+at the end.- On Garuda Linux anyway, it looks like an
@–>.rw-rwxr--@- Shows we have an ACL on the file.
- Also notice from the previous example, there is a
maskline: mask rwx- Shows the maximum allowed permissions.
- On Garuda Linux anyway, it looks like an
- Can also list permissions recursively.
getfacl -R /home > home-perms.txt
- Can see more information by using
man getfacl