Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a file on server that can be written by a group. The group is called "deploy" and the user is "mima." I have verified "mima" is in "deploy" with:

$ id mima
uid=1001(mima) gid=1002(mima) groups=1002(mima),1000(wheel),1001(deploy)

The permissions on the file I want to edit are:

$ ls -l application_helper.rb 
-rw-rw-r-- 1 deploy deploy 460 2012-08-13 21:30 application_helper.rb

This seems like it should work because the group deploy can write and mima is in that group, but I do get a permissions error.

share|improve this question
exclusionary lock by another process? – mdpc Aug 13 '12 at 21:43
up vote 2 down vote accepted

Did your user switch to that group with:

newgrp deploy


share|improve this answer
Ah that did it. I was under the impression adding a user to a group was enough so that a user can actively be in multiple groups. I'll have to read up a bit more on this stuff – Tony Aug 13 '12 at 21:50
Is there a way to have the user always be in that group? – Tony Aug 13 '12 at 21:52
@Tony it does work that way, but it doesn't apply retroactively to a user who is logged in while the change is being made to the user/group database. Privileges are decided at login time, granted to the login shell, and inherited from there by all descendant processes, so a user who's been put into a new group has to log in again to use it, or use a privileged (setuid) helper like newgrp or sg to gain the new gid. This also means if you want to revoke group membership, you have to kill all of the user's processes afterward to cut him off! – Alan Curry Aug 13 '12 at 22:30
Ah gotcha. Thank you for the explanation. – Tony Aug 13 '12 at 23:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.