![]() |
|
|
|
File PermissionsOne of the more confusing things for the aspiring web publisher is file permissions. It is important to understand the differences, because things could not work properly otherwise. The best way to explain this is with an example, so lets look at our bcpub.com/rtfm directory and the permissions there. To see the permissions you must type ls -lsa.
Each file has three seperate permission areas that you can assign. Each area also has three options of security. The three areas are owner, group, and public and the three options for each area are r-read, w-write, and x-execute. The listing in the directory also follows the owner,group,public scheme. So -rwxrwxrwx means that anyone can read, write, or execute the file but -rwxr-xr-x means that only the owner can do all three, the group and public can only read or execute the file. So with our directory listing above we see a file and several directories.
In the permissions section you can tell which listings are really directories by the d in front of all the permissions. So we have four directories and one file in this directory. The file is called manual.cgi and the four directories are . Looking at the file we see the following line.
This line tells us the following, From the permission scheme we see that both the owner and the group can read, write and execute manual.cgi and the public can only read and execute the file. With that all clear, you have to know how to assign those security options to the file. For this you need to understand the chmod command. The chmod command stands for change mode and has the following sytax chmod area +/- permission file.extor with all the options chmod ugoa +/- rwx file.ext The options for the area are u = the file's user (or owner) The +/- stands for + = assign this permission And the rwx is r = read access Well on to some examples. chmod a+x = let everyone execute the file |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||