[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Examples] [Book] [Tutorial] [API]
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.
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.
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.
Both files and directories have three basic kinds of permissions: read, write, and execute.
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.
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.
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.
% chmod go+x /home/student % chmod go+x /home/student/stuff % chmod go+x /home/student/stuff/animals
% chmod go+r /home/student/stuff/animals/zebra
animals
is not readable.
% chmod go-r /home/student/stuff/animals
I'd like to create a ``drop box'' where people can put files but can't see them once they're there.
% chmod go+wx /home/student/DropBox
% chmod go-r /home/student/DropBox
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
.
% chmod go-rw /home/student/restricted % chmod go+x /home/student/restricted
% chmod go+rw /home/student/restricted/comments
Wednesday, 15 September 1999
[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Examples] [Book] [Tutorial] [API]
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/99F/Handouts/file-permissions.html
Source text last modified Wed Sep 15 15:45:27 1999.
This page generated on Wed Sep 15 15:43:44 1999 by Siteweaver. Validate this page's HTML.
Contact our webmaster at rebelsky@grinnell.edu