Probably a little too dry for some, but hope this helps with how the numerical representation of permissions is arrived at. Sorry about some of the wording it was written as a newbie primer originally. When implementing scripts on *nix hosts the question that invariably comes up is how the numerical designation often given in instructions matches permissions. i.e some script instructions will say chmod such and such a file to 755, but how does that relate to the read write execute designations more commonly seen when using an FTP client for example?
The permission structure is not related to telnet or FTP but Unix. The structure of "Owner, Group, World" and "User, Group, Other" are interchangeable, they mean the same thing.
On Unix systems when a user account is created it is assigned it's own unique identifier. When that user creates a file or a directory, Unix attaches the unique identifier of the account that created it, he/she is then identified as the "Owner" or "User" of that file or directory and resources (i.e. programs, scripts, etc.).
Unix also allows you to have users belong to a "Group". In simple terms, this is done by assigning multiple accounts, or users to the same group. The reason for this is to allow users to share common access rights to files, and 'resources', that belong to the same group as this "group" of users, this is all based on the resource's permissions for "Group".
Users who are neither the "Owner/User" or within the "Group" are treated as "World/Other".
So that defines who everyone is in relation to files, directories, pograms, etc, but what are they allowed to do with these files, and programs?
That's where permissions come in. For each resource you define what they are allowed to do to the resource you are changing permissions on. The possibilities are
"rwx" (r)ead, (w)rite, e(x)ecute, for Owner/User,
"rwx" for Group,
"rwx" for World/Other
The permissions are actually specified in binary, so each position for "rwx" can be "on" or "off". If you want the Owner/User to be able to (r)ead, (w)rite, and e(x)ecute this file, you would turn all bits to "on" or 111, the thing to remember is that this is binary 111 not the decimal number 111. Repeat this for "Group" and you have three more digits to repesent "rwx", do it again for "World/Other" and you have three more binary digits to represent "rwx". This gives three sets of three binary "digits (a misnomer in this case)", and converting these binary sets, gives a three digit decimal number.
As we all know in the decimal number system each position has a significance based on the position it holds relative to the base. So we recognize that in the decimal number 1059, the 9 occupies the "ones" position, the 5 occupies the "tens", the 0 occupies the "hundreds", and the 1 occuppies the thousands. This tells us that the 1 in 1059 is actually 1000, and and the 0 is a placeholder for hundreds, the 5 is actually 50, and the 9 is 9. We don't think about it this way normally but it really stands for 1000+0+50+9 = 1059.
The positions of significance are arrived at by raising the base to the power of 0 thru infinity.
10^0 = ones
10^1 = tens
10^2 = hundreds
10^3 = thousands
.
.
The same is true for binary, but since we are dealing with a base 2 numbering system each position of significance can be represented by just two digits, a "0" or a "1" instead of the ten digits (0-9) available in decimal numbers.
2^0 = ones
2^1 = twos
2^2 = fours
2^3 = eights
.
.
Counting in binary then, the number 101 represents the number 5, the 1 occupies the "ones" position, the 0 occupies the "twos" position, and the 1 occupies the "fours" position. This tells us that the 1 is actually a 1, the 0 is a placeholder for the "twos", the 1 is actually a 4. So it really stands for 1+0+4=5
Let's go back to the permissions now. So rwx are represented by a 1 or a 0. A 1 when it is allowed and a 0 when it is not.
So we want to give:
"Owner/User" rwx permissions
anyone in the same "Group" r-x (note the dash, to maintain numerical significance)
And everyone else (Wold/Other) read and execute r-x
Assigning the on off bits to correspond to rwx would give:
"Owner/User" 111 (rwx)
"Group" 101 (r-x)
"World/Other"101 (r-x)
Let's do the math:
111 = 4+2+1 = 7
101 = 4+0+1 = 5
101 = 4+0+1 = 5
755 (rwxr-xr-x)
FTP clients usually structure the check boxes for each of these the same way, you check it and it is "on" (binary 1), you uncheck or leave it blank it is "off" (binary 0) and there are three sets of three to cover all possibilities of permissions.