|
Just to clarify, a '7' is complete access: Read, Write, Execute. A directory has to have Read/Execute perms in order to function properly, at the least. Directories shared to other users in your same group will usually require all permissions, whereas 'world' permissions should almost always be Read/Execute only, or '5'. The appropriate directory perms for anything shared via the web should be either 775 or 755, almost never 777. If someone from the public is allowed to write to the directory and to your script, they could potentially gain access to the server, or change your script to do whatever it is they want it to do.
The way UNIX permissions work is like this:
4 = Read
2 = Write
1 = Execute
Add the values up to figure out what perms a certain file or directory should have. For example, your script should be 755, or
4+2+1 = 7 (ALL PERMS) / 4+1 = 5 (Read/Execute) / 4+1 = 5 (Read/Execute)
The first value is USER, second is GROUP, third is WORLD.
Regular files like html/php pages, images, etc. are usually 644, executables (like Perl CGI scripts) are 755, directories also 755.
Hope this makes things a little clearer for you.
|