Quote:
Q. My script don't work?
A. You have the permissions set wrong. Try chmod 755
Q. HOW?
|
chmod = change mode = set the permissions.
Many are unsure how to do this, and once the how is figured out the confusion between Octal and symbolic shows up...
Q. How to do it?
The answer to this question is easy if you are using telnet. From the prompt simply type
chmod mode filename
[example: chmod u=rwx,go=rx file.cgi (u = user, g = group, o = other)]
There is more info available in telnet by typing
man chmod or better yet type
info \(fileutils\)
If you are using an FTP program, the answer varies.. usually you need only right click on the file and the option will be in the menu. If not, open HELP and search for "chmod" or "permissions" or "change mode". Most FTP programs have this feature readily available. Some utilize octal, others utilize symbolic, yet others offer both. Making it equally important to understand how to convert between the two.
Octal and symbolic???
Some scripts may say
755 this is octal. Others may say
-rwxr-xr-x this is symbolic. They both are telling you to set the permissions the same exact way
Read = r = 4
Write = w = 2
Execute = x = 1
There are three types that can get to a file if you allow them to... The Owner, The Group, and Everyone else.
So let's say myfile.cgi needs me, the owner, to be able to do everything (read it, write to it, and execute it), we need the group (people/machines with my same access) to be able to read it and execute it but we do not want them to write to it, and we need the same permissions given to everyone else.
User = rwx or 7 (since 4 + 2 + 1 = 7)
Group = r-x or 5 (since 4 + 0 + 1 = 5)
All = r-x or 5 (since 4 + 0 + 1 = 5)
The above equals
chmod 755 or
chmod u=rwx,go=rx
When you realize the permissions you set on a script are you giving yourself and the group and EVERYONE else permission to do things to your file, it's easy to see why mode 777 is not always a wise idea
Default modes if you upload a file to the server and change nothing:
All Files that are not scripts or directories
644 = -rw-r--r--
User everything everyone else just read.
All directories and anything that "looks like" a script
755 = -rwxr-xr-x
User everything, Group and Other can read and execute
------------------
Unlocking the Power of the Internet!
www.FutureQuest.net
[This message has been edited by Deb (edited 01-26-99).]