I was recently added to a group on the unix server. My active screen session has not been update to the new groups:

$screen -r

Without closing my screen session is there a way for me to use my new privileges in the screen session? Or if not, is there at least a way I can save all of the different directories each of the tabs are on?

Thanks, Dan


Take a look at the newgrp command.

  • 3
    exec newgrp if you don't want to leave an useless shell process hanging. – grawity Mar 26 '10 at 21:00
  • Also note that you will still have the old groups on any newly created (ie. C-a, C) windows in that particular screen session. – grawity Mar 26 '10 at 21:02

Unfortunately, unix groups are generally established at login, so you will have to log out and log back in to get the additional group permissions. That does mean killing your screen session.

  • How are the groups determined? Does the kernel store groups for each process, or is it that the processes don't think they are part of that group? It seems like it would be possible to update the groups for a live process with a debugger. – intuited Mar 26 '10 at 18:02
  • @intuited: Unix systems store the uid/gid/euid/egid/groups in the kernel's "process table". So unless you like hacking at the kernel internals with a debugger... – grawity Mar 26 '10 at 20:59
  • hmm.. so what if you forked the process? would the forked process get the new group set? ..wait, no, it would have to do whatever newgrp does. at least. – intuited Mar 27 '10 at 9:35

Give newgrp a shot.

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.