This is on a CentOS 5.3 server

I am logged in as myUser.
myUser is added to a new group while logged in. (root edits the /etc/group file in another session)
How can I get the change to take effect without logging out and logging back in?

Bill

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

Have the user run:

exec su $USER

Or:

exec sudo -u $USER -s

That will replace their login shell with a new login shell that's been freshly logged in as them. su will definitely prompt them for their password. sudo might not, but I believe will require configuring /etc/sudoers so the user has permission to run a shell as themselves. If you leave out the "exec", the user will have to "exit" twice.

On Unix, when you login there's a period where there's software running as root that's authenticated the user, which then sets up the groups before switching to running a shell as that user. After that, there's no way to change the permissions without involving software run as root again.

link|improve this answer
feedback

This is pretty much impossible because the login session reads at the beginning the group file. If you initiate a new login session you might be able to do it but i think it is not possible.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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