Board index » Original Member Tutorials: Why not write one Today » General Tutorials

 


Post new topic Reply to topic
Author Message
 Post subject: Tutorial - Setting Permissions in Linux
PostPosted: Sun Mar 05, 2006 1:07 am
  

User avatar
Site Admin

Joined: Sat Feb 11, 2006 10:44 pm
Posts: 6601
Location: UK :-)
Code:
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?

_________________
Drugs have taught an entire generation of kids the metric system..

TAZ's better half: http://www.theadminzone.com/


          Top  
 
 
Post new topic Reply to topic



Who is online

Users browsing this forum: No registered users and 0 guests


Display posts from previous:  Sort by  
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group