0

Adding a user to new groups in linux is easy -- you just need the following command:

# adduser user group

But this doesn't really do anything till you log off and then log in anew. When you have a GUI session, for instance Xserver, you have to completely shut it down.

I know that there's the newgrp command to "log in to a new group", but the question is why does the user session have to be restarted so the new group settings could be applied?

1 Answers1

1

It's well explained here What is a process GID and what purpose does it serve?

When you change user groups the root process for your GUI session remains intact and all newly run program still inherit the old user and group IDs.

This can be solved by running su - username - a new shell will have the new group IDs applied.