[K12OSN] file permissions for different groups?
hick518 at yahoo.com
Wed Jun 14 23:07:52 UTC 2006
--- Krsnendu Dasa <krsnendu108 at gmail.com> wrote:
> I am not sure if I understand.
> 0022 makes read/write access for owner and read only
> access for the group..
> 0002 adds write access for the group..right?
Think of umask as "taking away" permissions, whereas
chmod grants them.
For instance, with the chmod command, the permissions
can be granted in octal format where 1=execute,
2=write, 4=read. So "chmod 755 myfile" gives
read/write/execute (4+2+1=7) to user, and read/execute
(4+1=5) to group and other.
To get the default permissions to be 755 using umask,
set the umask to 022. This subtracts 022 from 777
(full permissions) and the result is 755.
If you wanted the default permissions to be 775
(read/write/execute for user and group, read/execute
for other), set the umask to 002.
Note that I'm only using 3 digits in the chmod and
umask. The system "converts" this to 4-digit format
by adding a leading zero. So "chmod 755 myfile" is
the same as "chmod 0755 myfile". Likewise, "umask
022" is the same as "umask 0022". I can't remember
the purpose of the first field is, but I think it has
something to do with setting the user ID or group ID.
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
More information about the K12OSN