![](https://seccdn.libravatar.org/avatar/8b81dbe145e983433d311382c4b690b7.jpg?s=120&d=mm&r=g)
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 just tried this on both RedHat 3 & 4 and don't see this. I think it just has to do with whatever your umask is for the user 'geecko'. This can be set in a bunch of different places, and usually has a default value assigned in a few places, but can always be changed by the user. In your case, your umask is 002, while in other places, like the default umask for openSUSE, it is 022. You can see what the umask is via the 'umask' command.
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?
This isn't possible under standard Linux usage. Files and the like don't inherit properties from directories, save in the special case you are doing here, which is setting the setguid bit on a directory, which means by default, files created are in the directory's group. You can set the default umask, but it can be overridden by a user. If you want user 'geecko' to create these group writable files, just change the umask in geecko's .bash_profile or .bashrc file: umask 0002 As mentioned, ACLs could probably fix this too, but those are necessarily enabled on every filesystem. -- Jonathan Arnold (mailto:jdarnold@buddydog.org) Daemon Dancing in the Dark, an Open OS weblog: http://freebsd.amazingdev.com/blog/ UNIX is user-friendly. It's just a bit picky about who its friends are. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org