System Administration Guide, Volume 2

How to Modify ACL Entries on a File

  1. Modify ACL entries on a file by using the setfacl command.


    $ setfacl -m acl_entry_list filename1 [filename2 ...]
    -m

    Modifies the existing ACL entry. 

    acl_entry_list

    Specifies the list of one or more ACL entries to modify on the file or directory. You can also modify default ACL entries on a directory. Table 17-8 and Table 17-9 show the valid ACL entries.

    filename ...

    Specifies one or more files or directories. 

  2. To verify that the ACL entries were modified on the file, use the getfacl command.


    $ getfacl filename
    

Examples--Modifying ACL Entries on a File

The following example modifies the permissions for the user george to read/write.


$ setfacl -m user:george:6 ch3.doc
$ getfacl ch3.doc
# file: ch3.doc
# owner: nathan
# group: staff
user::rw-				
user::george:rw-				#effective:r--
group::r-	              #effective:r--
mask:r--
other:r-

The following example modifies the default permissions for the group staff to read and the default ACL mask permissions to read/write on the book directory.


$ setfacl -m default:group:staff:4,default:mask:6 book