UNIX allows you to designate, on a file by file basis, who has permission to read it and write it. This is known as file permissions. When you upload a file, you become the owner of that file and it is assigned to the group you are in. But, unless you say that other group members have permission to write to the file, they cannot make modifications.
Suppose you list your files with the option ``-l'' (long format).
E.g.,
ls -l myfiles.*This is what you see with each listed file:
-rwxr--r-- username groupname 546 Dec 10 13:10 filename
When you upload a file to www, it sets the permissions by default so that the owner can read and write to the file, the group and world can only read it (-rw-r--r--). Ideally, we want the group to be able to write to it as well (-rw-rw-r--). There are a few ways to handle this.
Now, all files during that FTP session will be uploaded with the correct permissions.
-l Long format where you can see file permissions. -a This will not make files preceded by dots invisible. -g This shows the group name.So, you could do a ls -lag and incorporate all those features into one. Remember, if you want to see the contents one page at a time, pipe the listing to the program more by typing ls -lag |more.
Go into the directory where you want to change the permissions. If you want to change everything except for the directories, issue the following command:
chmod 664 *.*chmod means "change mode"...664 is a number combination that will set the permissions to what we want...and *.* means all files that contain a period. So, this will omit directories. For directories, you should issue the following command:
chmod 775 directorynameBut remember, you cannot be inside of the directory you are trying to change the permissions of.
In case you are interested, the following chart shows how we get the numbers 664 and 775. You just add up the numbers of the settings you want:
0400 Allow read by owner. 0200 Allow write by owner. 0100 Allow execute (search in directory) by owner. 0700 Allow read, write, and execute search) by owner. 0040 Allow read by group. 0020 Allow write by group. 0010 Allow execute (search in directory) by group. 0070 Allow read, write, and execute (search) by group. 0004 Allow read by others. 0002 Allow write by others. 0001 Allow execute (search in directory) by others. 0007 Allow read, write, and execute (search) by others.So, 664 is 0400 + 0200 + 0040 + 0020 + 0004.