![](https://seccdn.libravatar.org/avatar/be89a147cbe756b99b6360f4cfdb5c80.jpg?s=120&d=mm&r=g)
On Tuesday 22 May 2007 23:54, Fajar Priyanto wrote:
Hi all, Most of the time I administer Redhat server. However, recently I spend more and more time exploring Opensuse.
There's one thing that I don't get it yet regarding sgid and umask in Opensuse.
In RH, when I create a directory say 'test', chmod it 3770. It will look like this: drwxrws--T 2 root sales 4096 2007-05-23 08:16 test Then, when I create a file inside the directory, it will have permission like this: -rw-rw-r-- 1 geecko sales 4 2007-05-23 09:14 filegeecko (notice the rw-rw-r--).
I do the same in Opensuse. But, the file created in the directory have the permission: -rw-r--r-- 1 geecko sales 4 2007-05-23 09:17 filegeecko (notice the rw-r--r--). This permission makes other user in sales group cannot edit geecko's file. User geecko has to specifically set the permission to 664 on the file.
How do I achive the default umask inhereted from the parent directory? I read some suggestions from google to adjust the global default umask, but I think it's a bit risky, or is it the only way?
Thank you very much.
Hello Fajar, This is because the default umask for normal users in RH is 002 which is key to what they call the User Private Group Scheme. The default umask for normal users in opensuse seems to be 022 -- at least on my system. Check the /etc/bashrc file on the RH Server. In this file we have the following "if" construct: if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then umask 002 else umask 022 fi This little test is what causes the umask thing in RH servers. This says that if the effective group name is equal to the username and the users effective id is greater than 99 then set the umask to 002. Otherwise set the umask to 022. Hope this helps, Phil -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org