Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

$groups
A B C D
$screen -r
$groups
A B C

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

share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

Take a look at the newgrp command.

share|improve this answer
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
add comment

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.

share|improve this answer
    
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
add comment

Give newgrp a shot.

share|improve this answer
add comment

Your Answer

 
discard

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.