Help - Search - Members - Calendar
Full Version: CHMOD Permissions and Settings
Neowin Forums > Help & Discussion Center > A Collection of Essential Guides
islanq
CHMOD is an older computer term that means "Change Mode" It lets the computer know or your server what other users can do to with a certain file. Many different applications and scripts use CHMOD and as a computer user you should get familiar with them.

In order for your CGI program to run, it must be executable by the server. Therefore, you must set the permissions so the server can read or execute your files, which usually means making your CGI programs world executable. The way you set your file permissions is by using the CHMOD commands.

The CHMOD's permission mask is a three-digit number. Each digit of the number defines the permission for a different user of the file. The first digit defines the permission for the owner, the second digit defines the permissions for the group and the third digit defines the permissions for everyone else (referred to by CuteFTP as public). Each digit works the same for each group of users: the owner, group, and public. What you set for one digit has no effect on the other two digits.

• Owner = the files users (you)
• Group = the files group
• Others = others

Permissions Definitions:
• r = read access
• w = write access
• x = execute access

Numerical Definitions:
• r = 4
• w = 2
• x = 1

You will come to recognize, if you do not already, Chmod as a word used for changing Permissions from within Telnet or your FTP client.

Some scripts will tell you to chmod 775 (for example). When using the numeric system, the code for permissions is as follows: 4 + 2 + 1 (rwx) = 7

The first number applies to Owner, the second number applies to Group, and the third number applies to Others. Therefore the first 7 of the chmod 775 tells Unix to change the Owner's permissions to rxw (because r=4 + w=2 + x=1 adds up to 7, this giving the Owner Read, Write, and Execute Permission. The second 7 applies to the group, this giving the Group Read, Write, and Execute Permission, and the last number 5, refers to Others (4 + 1= 5), giving Others only Read and Execute Permission. The permissions for chmod 775 look like this: rwx rwx -rx.

Permissions are always broken up into three groups of letters, however if there is a dash, this dash simply means that Permission wasn't given for that particular function, for example in the chmod 775, Permission to Write was not given to Others.

• --- (or 0) = no permission
• r-- (or 4) = read-only permission
• rw- (or 6) = read/write permission
• r-x (or 5) = read/execute permission
• rwx (or 7) = read/write/execute permission

Remember: the first 3 letters always apply to Owner, the second 3 apply to Group, and the third 3 apply to Others.


[400] r-------- [files, this will not let you accidentaly erase a file]
[444] r--r--r-- [files, this will allow the owner, users, and public to view only]
[600] rw------- [files, no one else can read or see files]
[644] rw-r--r-- [starting to get it?]
[664] rw-rw-r-- [files]
[666] rw-rw-rw- [files, this could very well cause chaos in satanic proportions...]
[700] rwx------ [programs / directories]
[750] rwxrx--- [programs / directories]
[755] rwxr-xr-x [programs / directories]
[777] rwxrwxrwx [using this will not be your lucky number...] \

Here are some files with access set on my web server. Notice the attributes are set in numbers.
user posted image


Here is the same directory through an FTP, notice this time they are showing you with letters to represent the attributes.
user posted image

Well, thats it for now, this is my 1st guide and I hope you found it insightfull and helpfull as well. wink.gif
Jay R.
thumbs_up.gif We need more guides like those. Helpful. thumbs_up.gifthumbs_up.gifthumbs_up.gifthumbs_up.gifthumbs_up.gif
Nelsinho
thanks for the guide thumbs_up.gif
Hypoxiaicon
Too drunk to understand lol...
Looks good lol tongue.gif
Nelsinho
^^ROFL laugh.gif laugh.gif laugh.gif happy new year friends biggrin.gif
islanq
Do you guys actually understand it or are you just saying nice guide to be nice to me tongue.gif
.:Daemon:.
I get it. Nice guide. tongue.gif
Hills420
I understand it. It was very helpful for those of us that use NIX on a daily basis.
Inertia
thumbs up biggrin.gif

a helpful referance
Jack Pearce
Nice, Thanks thumbs_up.gif
Larney
QUOTE(islanq @ Jan 1 2005, 23:37)
Do you guys actually understand it or are you just saying nice guide to be nice to me  tongue.gif
[right][snapback]585212179[/snapback][/right]

*Says in druken manner* Yeah m8, two potatoes and some rubber ducks. I'M ON IT thumbs_up.gif

[444] r--r--r-- [files, this will allow the owner, users, and plulic to view only]
Kilroy-was-here
Very helpful, thanks. thumbs_up.gif
Larney
Yeah, sorry forgot to mention, good guide thumbs_up.gif
islanq
Thanks for all the kind words, I'll make up another guide soon for u guys if u want. wink.gif
Larney
QUOTE(islanq @ Jan 3 2005, 09:19)
Thanks for all the kind words, I'll make up another guide soon for u guys if u want. wink.gif
[right][snapback]585220809[/snapback][/right]

Just a quick spelling mistake:

[444] r--r--r-- [files, this will allow the owner, users, and plulic to view only]public*

smile.gif
The Grasshopper
I had to CHMOD with my bb, i really didn't know how to do it...reading the install manual was a pain...this was very helpful..keep it up...GOOD WORK!
markjensen
* fixed "public" typo, since original post is too old for islandq to edit *

Nice guide. thumbs_up.gif Good explanation of Unix file permissions for non-*nix users.
Larney
QUOTE(markjensen @ Jan 3 2005, 16:14)
* fixed "public" typo, since original post is too old for islandq to edit *

Nice guide. thumbs_up.gif  Good explanation of Unix file permissions for non-*nix users.
[right][snapback]585222506[/snapback][/right]

There is a limit on how long a member can edit a first post blink.gif?
markjensen
QUOTE(Larney @ Jan 3 2005, 11:25)
There is a limit on how long a member can edit a first post blink.gif? [right][snapback]585222885[/snapback][/right]
Seems to me it is about a day or so. Try editing one of your older posts, and see.
Larney
QUOTE(markjensen @ Jan 3 2005, 17:34)
Seems to me it is about a day or so.  Try editing one of your older posts, and see.
[right][snapback]585222932[/snapback][/right]

I am from a few months back. It's only posts after the first one that can't be edited, as far as I know, but members can edit posts for an unlimited time when they are the original poster.
Jay R.
QUOTE(Larney @ Jan 3 2005, 12:36)
I am from a few months back. It's only posts after the first one that can't be edited, as far as I know, but members can edit posts for an unlimited time when they are the original poster.
[right][snapback]585222943[/snapback][/right]

blink.gif I cant wacko.gif edit my post huh.gif after a certain time pinch.gif even tho I'm the original whistle.gif poster
Larney
QUOTE(AresXP @ Jan 3 2005, 18:12)
blink.gif I cant  wacko.gif edit my post  huh.gif after a certain time  pinch.gif even tho I'm the original  whistle.gif poster
[right][snapback]585223185[/snapback][/right]

Worrying, oh well...on with the topic.....
Jugalator
Yes, guides like these are useful. smile.gif

If you're going to administer FTP's or e.g. Linux boxes, reading up on the actually quite simple but flexible permission system is a must. And this guide helps in overcoming the "774, rwrwx... wtf??" step. smile.gif Actually, I like this permission system more than the one in NTFS since it feels so complex (talking about the "advanced" settings on the security tab in file properties) when you can basically accomplish anything you wish from the simple system in *nix, looking historically.
islanq
Yeah, I really wish Microsoft would have implimented CHMOD (even a more user friend version) for Windows XP Pro. That would have been a really nice feature.
Joel
QUOTE(Larney @ Jan 3 2005, 11:25)
There is a limit on how long a member can edit a first post blink.gif?
[right][snapback]585222885[/snapback][/right]

QUOTE(markjensen @ Jan 3 2005, 11:34)
Seems to me it is about a day or so.  Try editing one of your older posts, and see.
[right][snapback]585222932[/snapback][/right]

Thread starter can edit forever.
islanq
^ They can only edit their 1st post though wink.gif correct?
Joel
QUOTE(islanq @ Jan 3 2005, 19:35)
^ They can only edit their 1st post though wink.gif correct?
[right][snapback]585225894[/snapback][/right]

Correct.
islanq
Does anyone have any other request for a tutorial / guide?
darth_mark
QUOTE(islanq @ Jan 2 2005, 06:37)
Do you guys actually understand it or are you just saying nice guide to be nice to me  tongue.gif
[right][snapback]585212179[/snapback][/right]



i don't understand a word of it.
but i'm saying nice just to be cool. wink.gif
islanq
@ darth_mark

Man that is as user friendly as anyone can explain it to someone. Arg... I tried my best cry.gif
unksi
This guide is good and clear. Nice job islanq smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.