views:

136

answers:

3

I have a file that a colleague and I are editing together, on a unix system. We are using unix group permissions to edit it. We have one unix group that we are both members of. Whenever I save the file, it changes the unix group to one that he is not a member of. Is there any way to stop it from doing that?

A: 

Take a look at umask on your system.

Joe Suarez
OK, default dot files set by our sys admins use a umask of 022. What's a good umask for "don't change it!"?
asbruckman
umask is for default permissions, not group ID.
moonshadow
+2  A: 

Your options are to set the sticky bit on the directory to force files within it to match its group ID, or to use newgrp(1) to open a shell with the desired group ID before editing the file.

moonshadow
A: 

One option is to switch group using the command newgrp. It may ask for the group password that you may set with gpasswd.

jassuncao