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.

  • exclusionary lock by another process?
    – mdpc
    Aug 13, 2012 at 21:43

1 Answer 1


Did your user switch to that group with:

newgrp deploy


  • 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, 2012 at 21:50
  • Is there a way to have the user always be in that group?
    – Tony
    Aug 13, 2012 at 21:52
  • 1
    @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, 2012 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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