chacl command examples

chacl command examples

chacl – change the access control list of a file or directory

A minimum ACL:

#chacl u::rwx,g::r-x,o::r-- file

The file ACL is set so that the file’s owner has “rwx”, the file’s group has read and execute, and others have read only access to the file.

An ACL that is not a minimum ACL, that is, one that specifies a user or group other than the file’s owner or owner’s group, must contain a mask entry:

#chacl u::rwx,g::r-x,o::r--,u:bob:r--,m::r-x file1 file2

To set the default and access ACLs on newdir to be the same as on olddir, you could type:

chacl -b `chacl -l olddir | \
sed -e 's/.*\[//' -e 's#/# #' -e 's/]$//'` newdir


Leave a Reply

Your email address will not be published. Required fields are marked *