|
|||
1. Solaris ZFS File System (Introduction) 3. ZFS and Traditional File System Differences 6. Working With ZFS Snapshots and Clones 7. Using ACLs to Protect ZFS Files Setting and Displaying ACLs on ZFS Files in Verbose Format 8. ZFS Delegated Administration |
Setting and Displaying ACLs on ZFS Files in Compact FormatYou can set and display permissions on ZFS files in a compact format that uses 14 unique letters to represent the permissions. The letters that represent the compact permissions are listed in Table 7-2 and Table 7-3. You can display compact ACL listings for files and directories by using the ls -V command. For example: # ls -V file.1 -rw-r--r-- 1 root root 206663 Feb 16 11:00 file.1 owner@:--x-----------:------:deny owner@:rw-p---A-W-Co-:------:allow group@:-wxp----------:------:deny group@:r-------------:------:allow everyone@:-wxp---A-W-Co-:------:deny everyone@:r-----a-R-c--s:------:allow The compact ACL output is described as follows:
Compact ACL format provides the following advantages over verbose ACL format:
For information about using the verbose ACL format, see Setting and Displaying ACLs on ZFS Files in Verbose Format. Example 7-10 Setting and Displaying ACLs in Compact FormatIn the following example, a trivial ACL exists on file.1: # ls -V file.1 -rw-r-xr-x 1 root root 206663 Feb 16 11:00 file.1 owner@:--x-----------:------:deny owner@:rw-p---A-W-Co-:------:allow group@:-w-p----------:------:deny group@:r-x-----------:------:allow everyone@:-w-p---A-W-Co-:------:deny everyone@:r-x---a-R-c--s:------:allow In this example, read_data/execute permissions are added for the user gozer on file.1. # chmod A+user:gozer:rx:allow file.1 # ls -V file.1 -rw-r-xr-x+ 1 root root 206663 Feb 16 11:00 file.1 user:gozer:r-x-----------:------:allow owner@:--x-----------:------:deny owner@:rw-p---A-W-Co-:------:allow group@:-w-p----------:------:deny group@:r-x-----------:------:allow everyone@:-w-p---A-W-Co-:------:deny everyone@:r-x---a-R-c--s:------:allow Another way to add the same permissions for user gozer is to insert a new ACL at a specific position, 4, for example. As such, the existing ACLs at positions 4–6 are pushed down. For example: # chmod A4+user:gozer:rx:allow file.1 # ls -V file.1 -rw-r-xr-x+ 1 root root 206663 Feb 16 11:00 file.1 owner@:--x-----------:------:deny owner@:rw-p---A-W-Co-:------:allow group@:-w-p----------:------:deny group@:r-x-----------:------:allow user:gozer:r-x-----------:------:allow everyone@:-w-p---A-W-Co-:------:deny everyone@:r-x---a-R-c--s:------:allow In the following example, user gozer is granted read, write, and execute permissions that are inherited for newly created files and directories by using the compact ACL format. # chmod A+user:gozer:rwx:fd:allow dir.2 # ls -dV dir.2 drwxr-xr-x+ 2 root root 2 Aug 28 13:21 dir.2 user:gozer:rwx-----------:fd----:allow owner@:--------------:------:deny owner@:rwxp---A-W-Co-:------:allow group@:-w-p----------:------:deny group@:r-x-----------:------:allow everyone@:-w-p---A-W-Co-:------:deny everyone@:r-x---a-R-c--s:------:allow You can also cut and paste permissions and inheritance flags from the ls -V output into the compact chmod format. For example, to duplicate the permissions and inheritance flags on dir.1 for user gozer to user cindys, copy and paste the permission and inheritance flags (rwx-----------:f-----:allow) into your chmod command. For example: # chmod A+user:cindys:rwx-----------:fd----:allow dir.2 # ls -dv dir.2 drwxr-xr-x+ 2 root root 2 Aug 28 14:12 dir.2 user:cindys:rwx-----------:fd----:allow user:gozer:rwx-----------:fd----:allow owner@:--------------:------:deny owner@:rwxp---A-W-Co-:------:allow group@:-w-p----------:------:deny group@:r-x-----------:------:allow everyone@:-w-p---A-W-Co-:------:deny everyone@:r-x---a-R-c--s:------:allow |
||
|