What is chmod?

CHMOD is the action required to change the file permissions to make a file or directory writable or executable. You have most likely come across it before when adding a CGI script to your website - for the script to be executed you have to chmod it 755 (rwxr-xr-x).

Chmod is only necessary on Unix-derived platforms such as Linux, *BSD, Solaris and Mac OS X. It is not necessary on Microsoft Windows - due to the different security model used, all files are world-writable and anyone can execute the file.

How do I do it?

We've collected together a list of tutorials for the most popular FTP programs that explain how to do it.




A more technical discussion

Each file and directory has three groups of permissions, each comprising of three individual permissions. The groups are:

Permissions only affecting the current user
Permissions affecting the group of users that the current user belongs to
Affecting the permissions of everybody who comes into contact with the file

The individual permissions for each group are

read (r)
The user group can read this file
write (w)
The user group can run this file
execute (x)
The user group can run the program in this file

Each permission is given a numerical value:

r = 4
w = 2
x = 1

Therefore a file that is readable and writable by all user groups would have the code rw- rw- rw- (where - represents an unset permission). In numerical format, this equates to 666. Which of the two is easier to type? You've guessed it - 666! [[ Is there any better reason that a numerical value is available as well???? Bit bashing??? ]]