Difference between revisions of "Access Control Lists"

From MyWiki
Jump to: navigation, search
Line 4: Line 4:
 
'''To add users to acls in a directory structure with inheritance''' all of the directories in the folder structure must have a "default acl" set. After cd'ing into the relevant directory run the following<br>
 
'''To add users to acls in a directory structure with inheritance''' all of the directories in the folder structure must have a "default acl" set. After cd'ing into the relevant directory run the following<br>
 
find . -type d -exec setfacl -m user::rwx,group::rwx,other:---,mask:rwx,default:user::rwx,default:group::rwx,default:other:---,default:mask:rwx {} \;<br>
 
find . -type d -exec setfacl -m user::rwx,group::rwx,other:---,mask:rwx,default:user::rwx,default:group::rwx,default:other:---,default:mask:rwx {} \;<br>
 +
Having now set the default acls on all of the directories in the structure we need to add an entry for a particular user as follows<br>
 +
find . -type d -exec setfacl -m user:my01user:rwx,default:user:my01user:rwx  {} \;<br>
 +
Now we need to do the same for files<br>
 +
find . -type f -exec setfacl -m user:my01user:rwx  {} \;<br>

Revision as of 10:39, 23 July 2014

To set the default facl on a directory:
setfacl -m user::rwx,group::rwx,other:---,mask:rwx,default:user::rwx,default:group::rwx,default:other:---,default:mask:rwx <Directory name>
This configures the directory to propagate by inheritance any acls added to it for users

To add users to acls in a directory structure with inheritance all of the directories in the folder structure must have a "default acl" set. After cd'ing into the relevant directory run the following
find . -type d -exec setfacl -m user::rwx,group::rwx,other:---,mask:rwx,default:user::rwx,default:group::rwx,default:other:---,default:mask:rwx {} \;
Having now set the default acls on all of the directories in the structure we need to add an entry for a particular user as follows
find . -type d -exec setfacl -m user:my01user:rwx,default:user:my01user:rwx {} \;
Now we need to do the same for files
find . -type f -exec setfacl -m user:my01user:rwx {} \;