Fundamentals of Computer Science II (CSC-152 2000S)


Unix File Permissions

As many of you have noticed, Unix has a fairly complex schema for affecting the permissions of files. You can change permissions using the file manager or the chmod command.

Defaults

In the MathLAN, the default is for your files to be unreadable and unmodifiable by anyone except yourself. It is also the default that no one can see what files are in your directories are use any files in your directories.

From my perspective, these defaults are too cumbersome. At the very least, you should make your home directory accessible, if not readable, with

% chmod +x /home/yourname

Categories of Users

At times, you will need to give others access to your files. For example, you may want me to look at your files so that I can make a copy. At present, Unix only has three categories of people you can affect: yourself, you and other general users, and any user of our system. These are conveniently referred to as user, group, and other.

Types of Permissions

Both files and directories have three basic kinds of permissions: read, write, and execute.

File Permissions

When you give someone read permission to a file, it means that they can look at the contents of the file as long as they have appropriate access to the enclosing directories. When you give some write permission to a file, it means that they can modify the file as long as they have appropriate access to the enclosing directories. Don't worry about execute permission for files.

Directory Permissions

When you give some someone read permission to a directory, it means that they can list the contents of that directory as long as they have appropriate access to the enclosing directories. When you give someone write permission to a directory, it means that they can create and delete files in that directory as long as they have appropriate access to the enclosing directories.

What is appropriate access? It is execute access. Without execute access, there's not much anyone can do in or below a directory. I'd recommend that you make it a point to give execute access to any directories that others might use.

Some Tasks

I'd like other people to read a specific file, zebra, in /home/student/stuff/animals. They should not be able to tell what other files I have in that directory.

I'd like to create a ``drop box'' where people can put files but can't see them once they're there.

I'd like to create a file, comments, that anyone can modify. No one else should be able to add, remove, or even see files in its directory which I've called restricted.

History

Wednesday, 15 September 1999

Monday, 17 January 2000


Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.

This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS152/2000S/Handouts/file-permissions.html

Source text last modified Mon Jan 17 16:36:14 2000.

This page generated on Mon Jan 17 16:39:36 2000 by Siteweaver. Validate this page's HTML.

Contact our webmaster at rebelsky@grinnell.edu