CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

[Library Index]

[View category: Unix] [Discuss Article]

Guide to chmod

Article is yet to be rated
Author:      unknown
Submitted:      28-Apr-2007 19:41:02
Imported From:      The CyberArmy University (original author: )


Guide to chmod
drwxr-xr-x 3 bert nogroup 4096 Apr 12 20:15 websource
drwxr-xr-x 2 bert nogroup 4096 May 17 21:44 xp

Have you ever wondered what those means, and how to set them?

Basically, the 'd' means directory, there are others where 'd' is now, that
we need not worry about here.

After that, we have 3 groups of 3 digits. The first 'rwx' you can see, is the
permissions of the user who owns it, in this case 'bert'. The second 'r-x' is
the permissions of the group, and this applies to anybody in that group. In
this case, 'nogroup'. The third set is everybody that doesnt apply to the other
groups.

r - Read
w - Write
x - Execute (ie: permission to run, etc)

How do i apply these?

You run, chmod <3 digit number> filename/directory.

The 3 Digits?

The first digit is user, then group, then everybody else. The digits are definied
below:
7 - Read, Write, Execute
6 - Read, Write
5 - Read, Execute
4 - Read
3 - Write, Execute
2 - Write
1 - Execute

Obviously, some of the permissions wont work with others.

This is done in the format, chmod 777 filename. This would give ALL users full
acess. Where as 750, would give you full access, your group read and execute,
and nothing to anybody else.

You can also do chmod -R <3 digit code> directory. The will recursivley
chmod everything in the directory, including the directory.

Author Unknown

This article was originally published by CyberArmy.net in the CyberArmy Library.

You must be logged in to vote on an article

About Us | Privacy Policy | Mission Statement | Help