System Administration Guide: Security Services

ProcedureHow to Change ACL Entries on a File

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


    % setfacl -m acl-entry-list filename ... 
    
    -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 6–7 and Table 6–8 show the valid ACL entries.

    filename ...

    Specifies one or more files or directories, separated by a space.

  2. Verify that the ACL entries were modified on the file.


    % getfacl filename
    

Example 6–9 Modifying ACL Entries on a File

In the following example, the permissions for the user anusha are modified to read and write.


% setfacl -m user:anusha:6 ch3.sgm
% getfacl ch3.sgm
# file: ch3.sgm
# owner: stacey
# group: techpubs
user::rw-				
user::anusha:rw-        #effective:r--
group::r-               #effective:r--
mask:r--
other:r-

In the following example, the default permissions for the group staff are modified to read on the book directory. In addition, the default ACL mask permissions are modified to read and write.


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