Penguin Guy
August 29th, 2009, 01:07 PM
chmod is an abbreviation of change mode. There are two ways to chmod:
Symbolic (e.g. chmod +x)
chmod <people><+/-><permissions>
Example: chmod o-w (deny others from editing the file)
Example: chmod u+rwx (give the owner full control)
Exmaple: chmod +rwx (give everyone full control)
Example: chmod +x (allow anyone to execute the file)
Key:
r - Read
w - Write
x - Execute
u - The owner of the file
g - The group that the file belongs to
o - Anybody who is not one of the above
a - All users
+ - Add permissions
- - Remove permissions
Numerical (e.g. chmod 700):
: The first octet represents permissions for the owner.
r w x T : The second octet represents permissions for the group.
Owner: 4 2 1 7 : The third octet represents permissions for everyone else.
Group: 0 0 0 0 : For each octet, start at 0 and:
Other: 0 0 0 0 : +4 for read permission.
: +2 for write permission.
Command: chmod 700 : +1 for execute permission.
What is an octet? (http://ubuntuforums.org/showpost.php?postid=7891167) What Happened to +3? (http://ubuntuforums.org/showpost.php?p=7891167)
Read more: Wikipedia (http://en.wikipedia.org/wiki/Chmod). Man page (http://ss64.com/bash/chmod.html).
Symbolic (e.g. chmod +x)
chmod <people><+/-><permissions>
Example: chmod o-w (deny others from editing the file)
Example: chmod u+rwx (give the owner full control)
Exmaple: chmod +rwx (give everyone full control)
Example: chmod +x (allow anyone to execute the file)
Key:
r - Read
w - Write
x - Execute
u - The owner of the file
g - The group that the file belongs to
o - Anybody who is not one of the above
a - All users
+ - Add permissions
- - Remove permissions
Numerical (e.g. chmod 700):
: The first octet represents permissions for the owner.
r w x T : The second octet represents permissions for the group.
Owner: 4 2 1 7 : The third octet represents permissions for everyone else.
Group: 0 0 0 0 : For each octet, start at 0 and:
Other: 0 0 0 0 : +4 for read permission.
: +2 for write permission.
Command: chmod 700 : +1 for execute permission.
What is an octet? (http://ubuntuforums.org/showpost.php?postid=7891167) What Happened to +3? (http://ubuntuforums.org/showpost.php?p=7891167)
Read more: Wikipedia (http://en.wikipedia.org/wiki/Chmod). Man page (http://ss64.com/bash/chmod.html).