Setting Permissions
The chmod command uses as an argument a string which describes the permissions for a file. The permission description can be in the form of a number that is exactly three digits. Each digit of this number is a code for the permissions level of three types of people that might access this file:
- Owner (you)
- Group (a group of other users that you set up)
- World (anyone else browsing around on the file system)
The value of each digit is set according to what rights each of the types of people listed above have to manipulate that file.
Permissions are set according to numbers. Read is 4. Write is 2. Execute is 1. The sums of these numbers give combinations of these permissions:
- 0 = no permissions whatsoever; this person cannot read, write, or execute the file
- 1 = execute only
- 2 = write only
- 3 = write and execute (1+2)
- 4 = read only
- 5 = read and execute (4+1)
- 6 = read and write (4+2)
- 7 = read and write and execute (4+2+1)
Permissions are given using these digits in a sequence of three: one for owner, one for group, one for world.
Let's look at how I can make it impossible for anyone else to do anything with my apple.txt file but me:
$ chmod 700 apple.txt $
http://www.december.com/unix/tutor/permissions.html
http://codex.wordpress.org/Changing_File_Permissions