![]() |
Computer Systems Lab CS1000 |
![]() Wiscinfo |
![]() CS Home |
![]() CSL |
![]() CS1000 |
![]() Feedback |
Besides the directory permissions of AFS, each individual file has its own set of permissions assigned to it through the UNIX file system. These permissions can be displayed with the long (-l) option of the ls command.
vega1% ls -l
-rw------- 1 bucky 35421 Jan 12 16:44 mbox drwxr-xr-x 10 bucky 2048 Jan 16 17:18 private drwxr-xr-x 4 bucky 2048 Jan 10 15:43 public -rwxr-x--- 1 bucky 37 Dec 4 20:45 a.out
The first row of hyphens and characters are the permissions. The first character represents whether the item is a file or a directory. Next is three sets of read, write, and execute bits. Yep, they allow you to read, write, and execute files. The first set is the owner's permissions, followed by the group's permissions and other's permissions. Following the permissions is the number of links to a file and the file owner. You can list what group the file belongs to with the -g option of ls. Note that the write option doesn't need to be set to delete a file. Permission to delete the file is determined through the permissions given to a directory permissions. The owner permissions can be set (or rather unset) to prevent access to files in a directory. Since AFS should be used for setting directory permissions, we will not explain UNIX directory permissions here.
The chmod command changes UNIX file permissions, and takes the following syntax.
vega1% chmod <filename> [who] op permission
The who is any combination of u, g, o, or a (all). The op is any of the three operations: +, , or =. And the
permission is any combination of r, w, or x. For example, the
following allows me to edit my .Xdefaults file:
vega1% chmod u+w .Xdefaults