Department of Electrical and Computer Engineering

The University of Texas at Austin


EE 306
A Note Regarding the Security of Your Files in Unix
Yale N. Patt, Instructor
TAs: Linda Bigelow, Mustafa Erwa, Lester Guillory, Kevin Major,
   Abhay Pradhan, Moinuddin Qureshi, Paroma Sen, Santhosh Srinath,
   Matt Starolis, David Thompson, Vikrant Venkateshwar

Motivation

For the labs in this class, you will be using the Unix environment. The Unix environment allows each user to control who has access to the information in the user's home directory. For the purpose of preventing cheating, it is your responsibility to prevent your work from being accessed by the general public. This note provides directions to keep your work for each lab assignment private by setting the permissions of your files in Unix.

Listing the Permissions

From a Unix shell, issue the command ls -l as follows:
        tick.ece.utexas.edu% ls -l
        -rwxr--r--   1 dna      students       12 Sep  6 13:35 ExampleFile
        tick.ece.utexas.edu%
The ls command displays a listing of the files in the current working directory. The -l flag tells ls to provide a "long listing," which includes the permissions associated with the file. The permissions show up on the left and in this case they are: rwxr--r--.

An r indicates read permissions, a w write permissions, an x execute permissions and a - indicates a permission isn't granted. The permissions are broken into three sets of three: moving from right to left, the first set: rwx are the read, write and execute for the user; the second set: r--, are the read write and execute permissions for the group; and finally, the third set: r--, are the read, write and execute permissions for the public. For this set of permissions rwxr--r--, the user has read, write and execute permissions, but the group and the public have only read permission.

Changing a File's Permissions

You should set your permission such that only you, the user, has read, write and execute permission on your file. Use the following series of commands including the chmod command (change permissions mode) to change your files' permissions appropriately.
        tick.ece.utexas.edu% ls -l
        -rw-r--r--   2 dna      students       12 Sep  6 13:35 assemble.c
        tick.ece.utexas.edu% chmod 600 assemble.c
        tick.ece.utexas.edu% ls -l
        -rw-------   2 dna      students       12 Sep  6 13:35 assemble.c
        tick.ece.utexas.edu%
The 600 is an octal representation for these permissions: rw-------. It's left as an exercise for the reader to explain this octal encoding.

For further explanation see the man pages for ls and chmod or contact a TA.


Last Updated: 29 August 2002 -- kmajor