Assuming a new group without relogging

If you’ve ever added yourself to a POSIX group, you’ll notice that your group membership doesn’t change until you restart your current session. The reason being is that your group information is set at your initial login, and all child processes and virtual terminals under that login will maintain those initial groups.

Unfortunately there is no way (that I know of) to reload your group information for your parent session. However, it is possible to assume your new group membership using the newgrp command:

newgrp - nameofgroup

This command will intialize a new session and your user will now belong to the requested group. Please note that this command does not work if your group membership has not yet been set in /etc/group.

Share and Enjoy:
  • StumbleUpon
  • Facebook
  • Twitter
  • Reddit
Assuming a new group without relogging

Leave a Reply

Your email address will not be published.