Unix commands - CHMOD
The chmod command can be used to change the permission rights on subdirectories
and files in the Unix operating system. 

To find out your current permissions, you can use: 
	ls -laig 
	subdirectories	drwxrwxrwx
	files		-rwxrwxrwx
    	r=read		 \  /  \  /  \  /
	w=write		  =	others
	x=execute		        =	group
		  	             = u(owner)

u = user
g = group
o = other
a = all users

Kind of Permission 
Numeric file Permissions 

r . . . read file 
r has a value of 4 

w . . . write file 
w has a value of 2 

x . . . execute program file 
x has a value of 1 

Thus, to change the permissions, you add up the numbers for each of
the three sets and then put the three sets together.  i.e.  for 
others to see files, group to see files, and you to have full
permissions the command would be:
chmod 447 (filename/directory name, but, not in parenthesis)
It's 447 because read = 4 read = 4 and all three (read, write, execute
added together 4 + 2 + 1 = 7).  Simple.

Default permissions: 
By default, all Unix files you create will have the following permissions: 

2166 -rw-------   1 training      16 Jan  8 12:56 test.file

By default, all Unix directories you create will have the following permissions: 

132555 drwx--l---   2 training     512 Jan  8 13:06 Test.Dir

Permissions necessary to make them accessible to others: 
Files: 

2166 -rw-r--r--   1 training      16 Jan  8 12:56 test.file

Directories: 

132555 drwx--s--x   2 training     512 Jan  8 13:06 Test.Dir

Changing the permissions: 
chmod (who can read)(who can write)(who can execute) filename/directory 
1.on your home directory (done only once)
chmod 711 ~ 
2.on other directories (done only once)
chmod 711 Test.Dir 
3.on any file you create where others should have access (done every time you create a file)
chmod ugo+r test.file
chmod a+r test.file
chmod a+r *.* 

----------------------------------

How to Change Permissions 

+ . . . add permission 

- . . . take away 

= . . . make equal to 

-----------------------------------

Common numeric Permissions 

777 directories with write permission
755 cgi's and pl files
666 log files 

----------------------------------

Common Permissions 

a-w . . .Make read-only for everyone 

a+rx . . .Give everyone read and write 

go-rw . . .Take away permissions from everyone but you 
This site and all the contents
(unless otherwise specified)

© Eric W. Huff 1999-2015

All Rights Reserved