Andrew File System (afs): The UNIX File System

Introduction

The Andrew File System (afs) is the name of the file system that is used by the UNIX operating system on our machines. There are many commands that affect the files and directories that are available to UNIX users.

This tutorial will not teach you every afs command that you will ever need to know. Rather, the goal is to introduce you to some of the most useful commands for manipulating files and directories in UNIX. See more info for more suggestions.

Objectives

Topics

  1. View the access permissions for your home directory. (5 minutes)
  2. Change the access permissions for your home directory. (5 minutes)
  3. Create a new afs group that can be used for controlling access to files. (10 minutes)

Overview

In this tutorial you will learn the purpose of each of the commands listed above and how to use them.

View and change the access permissions for a directory.

Practice Exercise #1: View current directory permissions

  1. Open an xterm window if necessary.
  2. At the command-line prompt, type mkdir tempdir and press Enter. You have now created an empty directory with the same permissions as the parent directory of the directory created.
  3. Type cd tempdir to change to the directory that you just created.
  4. Type fs la . to list the acls (access list) for the current directory. Note: the period [.] in the command shown refers to the current working directory.
  5. Your permissions should look something like this:

    system:administrators rlidwka system:anyuser rl deppeler:rlidwka

    Of course, your CS login should be listed instead of deppeler.

Change the usage permissions for any of your files.

Practice Exercise #2: Set current directory permissions

  1. Type fs sa . CSlogin write to allow the user with the CS login name CSlogin to create and edit files in this directory. Note: This is not a good idea to do unless you want that user to be able to create and edit files in this directory.
  2. Your permissions should look something like this if you are intending to give the user with the CS login name "smoler" the ability to read and write files in this directory:

    system:administrators rlidwka system:anyuser rl deppeler:rlidwka login:rlidwk

  3. The possible permissions are as follows:

Create a new afs group that can be used for controlling access to files.

Practice Exercise #3: Create a users group for controlling access.

  1. Type pts creategroup deppeler:cs367_A0 to create a new users group that is owned by "deppeler". You may only create groups for yourself. So, replace "deppeler" with your CS login name. Choose a name for your permissions group that will be easy to remember later on, but that is not too long. Choosing a name that reflects the course and the project that you will be working on with this group of users is usually a good start. In the example below, I chose cs367_A0 to indicate any users that will need to be able to create and edit assignment 0 files for the course cs367.
  2. Your xterm should look something like this if you create the cs367_a0 group as described above:

    group deppeler:cs367_a0 has id -63860
  3. Type fs sa . deppeler:cs367_ao write to assign write permissions to all members of the newly created group.
  4. Type fs la . to list the acls again to see the results:
  5. Your xterm should look something like this:

    group deppeler:cs367_a0 rlidwk
  6. Type pts adduser smoler deppeler:cs367_a0 to add the user named "smoler" to the newly created group.
  7. Type pts membership deppeler:cs367_a0 to see the list of all users in this access group.
  8. Your xterm should look something like this:

    Members of deppeler:cs367_a0 (id:-63860) are: smoler
  9. Type pts removeuser smoler deppeler:cs367_a0 to remove the user named "smoler" from the group.
  10. Type pts delete deppeler:cs367_a0 to remove the group when it is no longer necessary.
  11. Type pts help to see a list of other commands that can be performed with the pts command.

Summary

In this lesson you have learned how to use the fs and pts commands of the UNIX environment.

Vocabulary

Directory

A special type of file that stores information about other files.

Directory Permissions

A set of rules that indicate which users can read, list, delete, etc files in the specified directory.

File

A collection of bytes of data.

File Permissions

A set of rules that indicate what the owner, user group and other users can do with a specific file.

Group

AFS permission groups can be created by any AFS user. Once a group is created directory permissions can be assigned to the group. This is much more convenient than specifying the same directory permissions for several users.

Where to Get More Information