GTA Technology Training

Mathematics Department
Penn State University
August, 2003

Managing File Access Permissions

Some files in your directory ought to be private, only readable by you. Your saved email messages fall into this category. Other files must be readable by everyone to be useful; for example, your web page files. Each file has information associated with it, known as its access permissions, which tells who can read, write, or execute the file.

The default on MathNet (and for UNIX systems in general) is that files you create are readable by everyone. This default setting isn't correct for all situations. Many undergraduates have MathNet accounts, so they could read exam drafts if the drafts were publicly accessible. Your grade records need to be private. So you need to change the access permissions of many files.

To change the permissions of a single file so that no-one else can read it, use the command chmod 600 filename. To make the file readable by everyone, use the command chmod 644 filename. You can check the permissions with the command ls -l filename; but the output is somewhat cryptic. I recommend reading an introduction to file permissions to learn more about access control on UNIX systems.

Changing the Default Permissions

If you want the files you create to be private by default, add the line umask 077 to the bottom of your .cshrc file, which is in your home directory. If you do this, you must explicitly make a file world readable before anyone else can read it. You will need to log out and log back in for changes in your .cshrc to become effective.

Locking a Workstation

Inevitably, you will need to leave the computer you are working at from time to time. When you leave a computer while logged in, other people can access your files. To prevent this, you should run the xlock program just before you leave. When you return, you must enter your password before you will be able to use the computer again. You should not leave a computer locked for long periods of time.


Next item: TeX and LaTeX