December 19, 2009

File /Folder Permissions

These are the numeric values and its related permissions in a linux system.

4000 - Setuid on execution
2000 - setgid on execution
1000 - set sticky bit
0400 - read by owner
0200 - write by owner
0100 - execute by owner
0040 - read by group
0020 - wrrite by group
0010 - execute by group
0004 - read by others
0002 - write by others
0001 - execute by others

The chmod numeric value varies from 0000 to 7777

You can use these or combination of these numeric values with chmod command or you can specify it with strings. While specifying with strings use the following arguments..
u - user - to add/remove permissions of user or owner of file.
g - group - to add/remove permissions of group members of file.
o - other - to add/remove permissions of other group members or world wide permission of file.

Eg:
The following commands will enable the setuid on the file abc.pl
chmod 4755 abc.pl
chmod u+s abc.pl

No comments:

Post a Comment