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

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?


share|improve this question
up vote 3 down vote accepted

Have the user run:

exec su $USER


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.

share|improve this answer

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.

share|improve this answer

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.