CU Home
Columbia University Information Technology
Setting Permissions

Web Design > Setting Permissions

Every file and directory in your site is protected from or made accessible to other users by setting its access permissions.

You can determine the permissions for the user, i.e. the owner (u), the group (g), or others, i.e. everyone else (o). In order to add permissions or take them away, use the command chmod and either a plus sign or minus sign respectively. The permissions you can add or take away are read (r), write (w), and execute (x) for the user, group and all the others.

You can set these permissions through some FTP clients such as WinSCP or by telneting to CUNIX and using the "chmod" command. Whichever method you select, you must give others (o) permission to read (r) each file that you wish to be visible through a Web browser unless specified otherwise.

To see what the existing permissions on a file are, telnet to CUNIX and use the command ls -lg filename:

$ ls -lg index.html
-rw-r----- 1 ariel  rad  5388  May 29 1999  index.html

The owner, ariel, can read and write to this file (rw-), the members of the group rad can read it (r--), however, everyone else can't read it (---). (Learn more about UNIX groups.)

Using the example above, to add write (w) permissions for the members of the group, rad, the owner, ariel, would type the following at the $ prompt:

$ chmod g+w index.html

Check to see if the permissions were properly set by using the ls -lg command

$ ls -lg index.html
-rw-rw---- 1 ariel   rad  5388 May 29 1999 index.html

Now the members of the group, rad, can make changes to the file index.html. However, ariel's file will not be visible through a Web browser because others (o) have not been given permission to read (r). To add this use the chmod command:

$ chmod o+r index.html
Check to see if the permissions were properly set by using the ls -lg command

$ ls -lg index.html
-rw-rw-r-- 1 ariel   rad  5388 May 29 1999 index.html

The file, index.html, can now be viewed using a web browser.


« Back to Web Publishing Home


Related Links Setting Permissions with WinSCP
Managing UNIX Groups
Enough UNIX for your Résumé