RSS
 

File Permissions

30 Mar

This page explains how to set file permissions for the three most common type of web files: pages, scripts and data/config files.

To keep things simple, let’s make the following assumptions:

a. pages should be readable/writable by the owner and readable by the web visitor.
b. scripts should be readable/writable/executable by the owner and readable/executable by the web visitor.
c. data-config files should be readable/writable by the owner and readable/writable by the web visitor.
And also, lets use the following abbreviations:

- – - (or 0) = no permission
r – - (or 4) = read-only permission
rw – (or 6) = read/write permission
rwx (or 7) = read/write/execute permission

To change UNIX file permissions using your shell account (Telnet):

When changing file permissions on a UNIX server, there are three groups to which you assign permissions: owner, group, other. Owner is typically you. Group is typically all users with accounts on your server. Other is typically the web visitors. Using the chmod command on a UNIX server, you can set the permissions for each of those groups.

1. Log into your account and go to the directory where the files are located
2. Use the chmod command to change permissions like so:
2a. chmod 604 page.html
2b. chmod 705 script.cgi
2c. chmod 606 config-data.txt

To change UNIX file permissions using your FTP software:

1. Log into your account and go to the directory where the files are located.
2. Highlight the file that you want to change permission.
3. Locate the “file permission” or “chmod” command on your FTP software software (you may need to refer to the manual or help file)
4. There should be three groups. Each group should have either checkboxes or a selection for the permission type.
4a. set pages to rw- for the owner, no permission for the group, and r–for other
4b. set scripts to rwx for the owner, no permission for the group, and r-x for other
4c. set data/config files to rw- for the owner, no permission for the group, and rw- for other

 
No Comments

Posted in *NIX

 

Leave a Reply

 
Please leave these two fields as-is: