Knowledge Base - FAQ

Question: Help! I don't understand UNIX file permissions!

To list the permissions for a directory telnet into your site and use the command:

ls -l <directory>

You will see a list of the files in the directory.  The first column of the list gives you information about the permissions on each file, such as:

-rwxrwxr-x

The ten-character string above can be interpreted as follows:

To change permissions on a file or directory use the chmod command.  The chmod command is of the form:

chmod xyz <filename>

Where x indicates the type of permission to be given to the owner, y indicates the type of permission to be given to the group, and z indicates the type of permission to be given to other users.  x, y and z are digits which are calculated as described below.  

Each type of permission has a numeric code:

You add up the relevant codes to figure out what number to use in your chmod command.   For example:

So to give the owner rwx access, the group r-x access and other people no access to the file test.cgi, you would use the command:

chmod 750 test.cgi

For more information please refer to the Linux manual page:

man chmod



Last Modified: Nov 19, 2010


Select a category
Search:

Kattare is Trustwave Certified and Safe Harbor Certified | Rated Safe For Kids by ICRA | All Rights Reserved Worldwide
Copyright © 1997 - 2012 Kättare Internet Services | Processed in 0.012 seconds by webmail in Corvallis, Oregon