linux:access-control-lists

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:access-control-lists [2017/10/27 18:11] – [Viewing ACLs] michaellinux:access-control-lists [2019/03/07 13:51] (current) michael
Line 13: Line 13:
 ''Note the **+** sign at the end of the permissions. This confirms that the file has an ACL attached to it.'' ''Note the **+** sign at the end of the permissions. This confirms that the file has an ACL attached to it.''
  
----- 
  
 ===== Viewing ACLs ===== ===== Viewing ACLs =====
Line 38: Line 37:
 </WRAP> </WRAP>
  
-Notice the 3 different user: lines. The first line lists the standard file permissions of the owner of the file. The 2 other user permissions are the individual permission for the user john and sam. The mask field here only applies to the additional permissions we have given to the user and groups. If the mask is set to rwx the read, write and execute permissions will be granted to additional user/groups. If the mask is set to r-x, the write permission will not be granted to additional user/groups.In general, <wrap em>DO NOT</wrap> set mask to anything other than rwx. The mask value doe not affect the standard UNIX user/group/others permissions.+Notice the 3 different user: lines. The first line lists the standard file permissions of the owner of the file. The 2 other user permissions are the individual permission for the user john and sam. The mask field here only applies to the additional permissions we have given to the user and groups. If the mask is set to rwx the read, write and execute permissions will be granted to additional user/groups. If the mask is set to r-x, the write permission will not be granted to additional user/groups.In general, ''<wrap em>DO NOT</wrap> set mask to anything other **than rwx****The mask value does not affect the standard UNIX user/group/others permissions.**''
  
  
 <WRAP center box 100%> <WRAP center box 100%>
 **File with no ACLs** **File with no ACLs**
 +
 ''If you run the getfacl command on a file with no ACLs the additional “user:” lines and “mask” line will not be shown and standard file permissions will be shown.'' ''If you run the getfacl command on a file with no ACLs the additional “user:” lines and “mask” line will not be shown and standard file permissions will be shown.''
 <code> <code>
Line 57: Line 57:
 </sxh> </sxh>
 </WRAP> </WRAP>
- 
----- 
  
  
Line 69: Line 67:
   * FACLs for multiple user and groups can also be set with single command : <code># setfacl -m u:john:rw,g:accounts:rwx /tmp/test</code>   * FACLs for multiple user and groups can also be set with single command : <code># setfacl -m u:john:rw,g:accounts:rwx /tmp/test</code>
  
- 
----- 
  
 ===== Default FACLs on directories ===== ===== Default FACLs on directories =====
 Default ACLs are only created on directories. When you set default ACLs on directories, any files created within that directory will also have that default FACL assigned automatically. Default ACLs are only created on directories. When you set default ACLs on directories, any files created within that directory will also have that default FACL assigned automatically.
  
-To create a default FACL on a directory :+**To create a default FACL on a directory:**
  
 <code># setfacl -m default:u:john:rw /accounts</code> <code># setfacl -m default:u:john:rw /accounts</code>
Line 99: Line 95:
 </WRAP> </WRAP>
  
-Now create a new file in the accounts directory and list the FACL on the file :+''//Now create a new file in the accounts directory and list the FACL on the file ://''
  
 <WRAP center box 100%> <WRAP center box 100%>
Line 119: Line 115:
 </WRAP> </WRAP>
  
----- 
  
 ===== Removing FACLs ===== ===== Removing FACLs =====
  
-To remove FACL, use the setfacl command with -x option :+''To remove FACL, use the setfacl command with -x option :''
  
 <code># setfacl -x u:john /tmp/test</code> <code># setfacl -x u:john /tmp/test</code>
  
-The above command removes the ACL for the user john on the file /tmp/test. The ACLs for other user/groups if any remains unaffected.+''**The above command removes the ACL for the user john on the file /tmp/test.** The ACLs for other user/groups if any remains unaffected.''
  
-To remove all ACLs associated to a file use the -b option with setfacl :+''<wrap em>To remove all ACLs associated to a file use the -b option with setfacl :</wrap>''
  
 <code># setfacl -b /tmp/test</code> <code># setfacl -b /tmp/test</code>
  
----- 
  
 ===== Backing up the FACLs ===== ===== Backing up the FACLs =====
Line 142: Line 136:
 # getfacl -R * > accounts_facl        ( -R -> recursive )</code> # getfacl -R * > accounts_facl        ( -R -> recursive )</code>
  
----- 
  
 ===== Restoring the FACLs ===== ===== Restoring the FACLs =====
  • linux/access-control-lists.1509120708.txt.gz
  • Last modified: 2017/10/27 18:11
  • by michael