computer tutorial 


SETTING PERMISSIONS IN LINUX

This paper is the work of The Master Jedi Pimpsor AKA thehorse13, who has kindly consented to it being hosted here on the TAZ.

The original post can be found here:
http://www.antionline.com/showthread.php?s=&threadid=251818

OK, enough people have asked me about Linux file permissions so I figured I'd write a short tutorial on how they work. It is *very* simple. Here we go...


Type this command at the console anyplace in the directory tree

#[Crack-Monsta@Localhost Acid]ls -ld

This will return something like this:

drwxr-xr-x 19 root root 4096 Nov 20 09:05

The first letter indicates a directory and tells you that the owner has Read Write and eXecute rights. Now, lets take this apart to see how this works:

If we break this up, from left to right you get this:

d rwx r-x r-x
directory Owner perms Group perms Everyone else perms

The "-" indicates that the right is turned off. So, we can say that the owner has full rights while the group and everyone else has read and execute only because the "-" tells us that the write permission is turned off.

CHANGING PERMISSIONS WITH CHMOD
================================

For some reason people are afraid of this command. You'll see someone do a chmod 777 on a file and you wonder to yourself, "What the hell is that all about?". It's easy. Each permission is assigned a value as follows
r (read) = 4
w (write) = 2
x (execute) = 1

So in chmod 777 you are giving full rights to the owner, the group and everyone else. Still confused? Look at this table below

chmod 777 files -- rwxrwxrwx
chmod 755 files -- rwxr-xr-x
chmod 644 files -- rw-r--r--
chmod 000 files -- ---------

So it is all just a matter of simple math to assign or revoke perms. That's it. Now, isn't that simple?

Original Tutorial Submitted by Nokia for TheTAZZone-TAZForum

Originally posted on March 4th, 2006 here

Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post...we do not sell, publish, transmit, or have the right to give permission for such...TheTAZZone merely retains the right to use, retain, and publish submitted work within it's Network.