TOC PREV NEXT INDEX INDEX

Setting permissions

In order for your scripts to operate properly, you must ensure that file and directory permissions are correct.

The /cgi-bin directory requires the following permissions:

Users Permissions Letters Numbers
User Read, write, execute rwx 7
Group Read, write, execute rx 5
Other/Public Execute only or read and execute x or rx 1 or 5

 

Some FTP clients provide a graphical interface that makes it easy for you to quickly set and change file and directory permissions. This section provides you detailed information on permissions. For instructions on setting permissions using common FTP clients, see Checking and changing permissions on page 82.


Understanding permissions

You can set permissions using either a numeric system or a letter-based system. The following table lists and describes the three different permission levels and the corresponding letter and numeral identifiers.

Permission
Description
Letter
Numeral
Read
User can view the directory or file contents.
r
4
Write
User can modify the directory or file(s).
w
2
Execute
User can execute files.
x
1

For example, full read, write and execute permissions could be assigned using the numeral "7" or the letters "rwx."

r = 4, w=2, x=1
4 + 2 + 1 = 7
rwx = 7

This, however, is only the first step in assigning permissions; you must also account for the different user types who may attempt to access a directory or file. The following table lists the different user types:

User type
Letter
The file's user (you)
u
The file's group
g
Others
o
All (the user, the group and others)
a

One way to specify user permissions is to specify the exact permissions for each user type. For example, this:

u=rwx,g=rx,o=rx

Grants:

Since there are three levels of permissions for each user type, you can also specify the permissions by using three sets of three letters. For example, the permissions specified by u=rwx,g=rx,o=rx above can also be specified by:

rwxr-xr-x

The first three characters always specify the permissions for the user, the next three characters specify the permissions for the group and the final three specify permissions for others. When a permission is denied, a dash ( - ) is used as a placeholder.

Instead of using letters, you can also specify permissions using a series of three digits, each of which is the sum of the three permission values. For example:

751 (equates to rwxr-x--x)
755 (equates to rwxr-xr-x)


Checking and changing permissions

To list the access permissions of a file or directory:

  1. Connect to your web server via FTP and navigate to the directory or file for which you want to set permissions.
  2. Right-click the directory or file name and perform one of the following actions:
    - If you are using WS_FTP, select the chmod (UNIX) command.
    - If you are using CuteFTP, select the Properties command.
  3. In the dialog box that appears, select the appropriate permissions for the Owner, Group, and Public/Other.

 



Way2Host
support@way2host.com
© 2003 Way2Host
All rights reserved.

TOC PREV NEXT INDEX INDEX