Newbie’s Guide to Setting File Permissions
whySetting file permissions is one of the most intimidating processes a new webmaster can undertake. While there is nothing difficult about actually setting file permissions, the technical “mumbo jumbo” behind the process can be confusing to non-programmers. I’m not going to discuss the “hows” and “whys” of choosing “what” a file’s “permissions” should be – that is left to the programmer to decide; and if you can write a useable CGI script, you don’t need this article!
However, if you’re a busy webmaster like me who doesn’t always need to know why he’s doing something, only that it needs to be done (like when installing a Pic Post script for instance), you’ve come to the right place. I’m going to walk you through the process, step by step, using the two most popular pieces of ftp software, CuteFTP and WS_FTP Pro.
Understanding the Basics
First, a little background: when you are required to set file permissions at the level I’m discussing (as part of script installation), you will be given an instruction like “set admin.cgi to 755” or “CHMOD admin.cgi – 755.” This number represents a combination of Read, Write, and Execute Permission for each of three user groups that needs to be set for a specific file, in this case, “admin.cgi.” These user groups are (from left to right) Owner, Group, and Other (or Public). In the above example, “755” designates permissions as “7” for Owner, “5” for Group, and “5” for Other. Confused? Relax, if you can add to “7,” you can set file permissions. Since doing it is easier than explaining it, let’s jump right in…
Setting Permissions Using CuteFTP
Using CuteFTP, open your web site and "right click" on the file whose permissions you need to set. Select "Change file attributes" from the pop-up menu and a dialog box will appear with Read, Write, and Execute "check boxes" for Owner, Group, and Public (Other) permissions. There is also a text input box labeled "Manual."
You can either type the number you wish (for example, 755) directly into the "Manual" box, or "check off" the appropriate boxes to set permissions. As you check these boxes, the number in the Manual box will change accordingly, verifying you have the permissions set correctly. Once the number in the "manual" box matches your desired setting, click "OK."
A verification box will appear; click "OK" again. If you get something wrong, repeat the process until you get it right – you won’t "break" anything. It’s that simple, and doing this a few times will really help you understand how easy this process can be.
Setting Permissions Using WS-FTP Pro
The procedure for setting file permissions using this popular piece of software is nearly identical to that used with CuteFTP; clicking on "checkboxes" to set permissions. CuteFTP may be easier for newbies to use because of its "Manual" indicator that takes the guesswork, and mathematics, out of the process, but if you are a WS-FTP Pro fan, stick with it. As long as you can add to "7," you’ll do ok.
Here’s how: Read permission has a value of “4,” Write permission’s value is “2,” and the Execute value is “1.” When added together, Read, Write, and Execute permissions = “7,” or 4+2+1. When these three numbers are added together, and then set for each of the three permission groups, you get a valid “CHMOD mask.”
Still confused? Click here to learn more about Unix File Permissions…