The biggest obvious difference between ACLs and traditional UNIX file permissions is that an ACL is used to apply permissions to an entire directory in an AFS volume; it cannot be used to apply permissions to individual files within a directory a la the UNIX chmod command. Related to this, the ACL of a parent AFS directory is also automatically inherited by any new child subdirectories created in or moved into the parent directory. The only way to change the ACL of the child subdirectory is to separately apply a different ACL to it.
ACLs are created, modified, and examined with the AFS fileserver command (fs) followed by various subcommands and ACL arguments. For example, to examine the default ACL applied to your GPU Logon Server home directory, enter the following at the GPU prompt:
gpu{jdoe}: fs listacl ~jdoe
The information returned by this command indicates that only the system administrator and yourself have access rights to your home directory. This is the default for all the AFS directories in the ualberta. ca cell.
To examine the ACLs of the files within a directory, cd to the directory and enter the following at the UNIX system prompt:
gpu{jdoe}: fs listacl *
Let's assume that you are the GPU user jdoe who wants to share the contents of a directory in your AFS volume with a colleague who has the GPU ID co-worker. The first thing to do is to create, in your home directory, the new directory you want to share:
gpu{jdoe}: mkdir shared.stuff
Put the files/programs you want to share in the new shared.stuff directory. Now, cd to your home directory and then examine the ACL of shared.stuff:
gpu{jdoe}: fs listacl shared.stuff
The command above returns the following ACL information:
Access list for /afs/ualberta.ca/j/d/jdoe/shared.stuff is Normal rights: system:administrators rlidwka jdoe rlidwkaThe returned information is the default ACL for directories in the ualberta.ca cell; it signifies that only the system administrator and yourself currently have full access to the shared.stuff directory. A new ACL must be applied to the directory so that the GPU ID co-worker can share its contents. To do this, cd to the directory that contains the shared.stuff directory (i.e., the directory above shared.stuff) and issue one of the following commands at the GPU UNIX system prompt. Both of these commands give all the ACL access control rights to co-worker except the administer right, i.e., the right to change the directory's ACL:
gpu{jdoe}: fs setacl shared.stuff co-worker rlidwk
... or ...
gpu{jdoe}: fs setacl shared.stuff co-worker write
If you don't want to give co-worker the ability to add, change, or delete files in shared.stuff, but only the ability to list and read/copy the files, modify the ACL for the directory with one of the following commands:
gpu{jdoe}: fs setacl shared.stuff co-worker rl
... or ...
gpu{jdoe}: fs setacl shared.stuff co-worker read
Check to see that the ACL rights for the shared.stuff directory have been changed to what you want by issuing the fs listacl command once more.
Now that you have applied a new ACL to the shared.stuff directory, co-worker is free to share the contents of the directory according to the access control rights stipulated in the fs setacl command. For example, the write package of rights gives the GPU ID co-worker the power to remove a file called old.txt from your shared.stuff directory with the following command:
gpu{co-worker}: rm ~jdoe/shared.stuff/old.txt
The owner of the co-worker ID could also copy a file called new.txt from his/her home directory to your shared.stuff directory with the command:
gpu{co-worker}: cp new.txt ~jdoe/shared.stuff/new.txt
Note that the last part of the command above is the filename given to the copied file by co-worker.
In like manner, the owner of the co-worker ID could open and edit a file called agenda.txt in shared.stuff using a file editor such as Pico:
gpu{co-worker}: pico ~jdoe/shared.stuff/agenda.txt
- system:administrators
(This group is comprised of University system administrators who have all access control rights to all directories in the ualberta.ca cell)
- system:authuser
(This group is made of all Kerberos-authenticated users in the local ualberta.ca cell)
- system:anyuser
(This group is comprised of all users, including non-AFS users,whether they are authenticated or not)
Typically, you would use a default system-wide protection group like system:anyuser to share a directory with the whole world, such as your public_html directory on GPU where you can store and share your World Wide Web home page and other HyperText Markup Language (HTML) documents. To do this, first apply the following fs setacl command to your home directory:
gpu{jdoe}: fs setacl ~jdoe system:anyuser l
This command gives all users lookup (l) access to your home directory (they can list the directory's contents, but not read or copy). This is required so that Web client programs can navigate through your home directory to your public_html directory.
Now, apply one of the following commands to your public_html directory:
gpu{jdoe}: fs setacl public_html system:anyuser rl
... or ...
gpu{jdoe}: fs setacl public_html system:anyuser read
Both of the previous commands give all users read and lookup access to your public_html directory, the required setup for sharing Web documents.
gpu{jdoe}: mkdir collaboration
Put the files/programs you want to share in the collaboration directory. Now, create an AFS group, e.g., group1, by issuing a command in the following form:
gpu{jdoe}: pts creategroup jdoe:group1
Define the members of group1 with a command in the following form:
gpu{jdoe}: pts adduser co-worker1 jdoe:group1
You can add members to the AFS group individually, as shown above, or you can simultaneously add multiple members to the AFS group with a command in the following form:
gpu{jdoe}: pts adduser -user co-worker1 co-worker2 co-worker3 -group jdoe:group1
Once you have added users to the AFS group, check to see that the membership is correct with the following command:
gpu{jdoe}: pts membership jdoe:group1
Now you are ready to apply an ACL to the collaboration directory which will give group1 the bundle of access control rights of your choosing. First, cd to the directory which contains the collaboration directory, then enter:
gpu{jdoe}: fs setacl collaboration jdoe:group1 rlidwk
Files and programs within the collaboration directory can now be shared by the members of group1.
In future, if you want to remove a member from group1, enter a command in the following form:
gpu{jdoe}: pts removeuser co-worker2 jdoe:group1
If you ever want to rename group1, enter a command in the following form:
gpu{jdoe}: pts rename jdoe:group1 jdoe:new-group-name
If, at some point, you want to delete the AFS group entirely, issue a command in the form:
gpu{jdoe}: pts delete jdoe:group1
This document is taken from the CNS, please refer to the original copy to make sure.
Edward Wong | ecw@ualberta.ca |
Edgar Wong | edgar@ualberta.ca |
Howard Shum | kshum@ualberta.ca |
Patrick Li | pwli@ualberta.ca |