Unix File/Directory Permissions:

Every file and directory has a set of values related to it that specifies its permissions.  The permissions indicate for each user, the kind of access allowed read, write or execute.

These permission values can be represented as an octal digit, as illustrated in the table below
  
Mode Octal  #
--- 0
00X 1
-X- 2
-WX

3

R-- 4
R-X 5
RW- 6
RWX 7

 RWX.gif (5174 bytes)

In regards to directory/file access, the Unix user community is divided up into three catagories:  user (owner),   group ( group members who agree to share certain files and directories.) and other (all others).    Every file and directory is assigned permissions for each categories.  FilePerm.gif (8859 bytes)

When you use the Unix list long command:   ls -l   Files and directories will be displayed along with permissions assigned to each of these groups.

The Unix command to change/assign permission is chmod.  The following   Unix instruction would give you the user (read, write, execute),   group ( read, execute), other ( read, execute) permission for all files ending in htm.

chmod  755  *.htm

The following screen capture illustrates the output from the ls -l command on UNIX account.  I then issue the chmod command and then ls -l again. (My commands are highlighted in pink.)  Notice the change in output before and after the chmod command.

telnetls.gif (12103 bytes)

My subdirectory test contains two directories; (d1,  images), and two files; (first.htm, index.html).  Before the chmod command was executed file first.htm had the following access rights:   user (read,write), group (read), others (read)   After the chmod 755 first.htm command was executed, file access rights were changed to:   user (read,write,execute), group (read,execute), others (read,execute)

The instruction for granting permissions to GIF & JPG files would be:

chmod  744  *.GIF   and       chmod    744   *.JPG respectively

Again a reminder, in UNIX file names are case sensitive, so you may have to repeat these commands in upper and lower case if you have files in both formats.

 

        

This page was last updated on 01/21/2003 by L.M. Hicks