next up previous contents
Next: Working With Groups Up: Sharing Files on RCS Previous: Changing File Permissions: Working

Using the chmod Command

chmod (change mode), the traditional file permission command, has limited capabilities in AFS. You can use chmod to reduce access to a particular file in a directory; that is, you can give the file more limited access than the directory itself.     You can also use it to make a file executable, which is appropriate for a file containing UNIX commands.  For example, you can use chmod to remove write access to a file in a directory that permits write access to all its files. However, you cannot use the chmod command to give write access to a file in a directory that does not permit write access to any of its files. Using the ls -l command will display all the files in a directory, with their related chmod permissions appearing on the left, as shown below.
\begin{alltt}
{\bf ls -l}
{\tt total 2048
-rw-rw-rw- 1 doylez user 1451 Dec 1...
...6 15:31 Initial.dt
drwxrwxrwx 5 doylez user 2048 Jan 20 09:11 News}
\end{alltt}

The command chmod has nine permission settings, with the chmod permission bits appearing to the left, and filenames to the right. AFS uses only the first three - read (r), write(w), and execute(x) bits and ignores the other bits. The first entry can be a dash (-), indicating a regular file, d, indicating a directory, or l, indicating a link. If the second entry appears as an r, anyone who has ACL read and lookup access to the directory can read that particular file. If the r bit does not appear, no one, including the owner, can read that file. If the third entry appears as a w, anyone who has ACL read, lookup, and write access to the directory can change that file. If the fourth entry appears as an x, anyone who has ACL read and lookup access to the directory can execute that program file. To set chmod permissions, use the command format
\begin{alltt}
{\bf chmod} {\it w}{\bf +}{\it p filename}
\end{alltt}
where

w
indicates that you want to permit the file to a particular user. Currently, the only valid AFS option is u, or ``user."
p
represents the chmod permission mode bits: r,w,x
+
means add permissions. You can also have a - here, which means to remove the indicated permissions.
filename
refers to the file for which you want to set permissions or access

Example: To add execute permission to the file article:
\begin{alltt}
{\bf chmod u+x article}
\end{alltt}
More detailed information is available via the chmod man page; to access it, type the following command from a UNIX window:

man chmod

next up previous contents
Next: Working With Groups Up: Sharing Files on RCS Previous: Changing File Permissions: Working
Send comments to consult@rpi.edu.