Sharing data: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 190: Line 190:
<!--T:8-->
<!--T:8-->
The file permissions discussed above have been available in Unix-like operating systems for decades now but they are very coarse-grained. The whole set of users is divided into just three categories: the owner, the group, and everyone else. What if you want to allow someone who isn't in a group to read a file - do you really need to make the file readable by everyone in that case? The answer, happily, is no. Our national systems offer ''access control lists'' (ACLs) to enable permissions to be set on a user-by-user basis if desired. The two commands needed to manipulate these extended permissions are  
The file permissions discussed above have been available in Unix-like operating systems for decades now but they are very coarse-grained. The whole set of users is divided into just three categories: the owner, the group, and everyone else. What if you want to allow someone who isn't in a group to read a file - do you really need to make the file readable by everyone in that case? The answer, happily, is no. Our national systems offer ''access control lists'' (ACLs) to enable permissions to be set on a user-by-user basis if desired. The two commands needed to manipulate these extended permissions are  
* <tt>getfacl</tt> to see the ACL permissions, and  
* <code>getfacl</code> to see the ACL permissions, and  
* <tt>setfacl</tt> to alter them.  
* <code>setfacl</code> to alter them.  


==== Sharing a single file ==== <!--T:19-->
==== Sharing a single file ==== <!--T:19-->
To allow a single person with username <tt>smithj</tt> to have read and execute permission on the file <tt>my_script.py</tt>, use:
To allow a single person with username <code>smithj</code> to have read and execute permission on the file <code>my_script.py</code>, use:
<source lang="console">
<source lang="console">
$ setfacl -m u:smithj:rx my_script.py
$ setfacl -m u:smithj:rx my_script.py
rsnt_translations
56,420

edits