Can adding to a new group be effective in current login environment without re-login?

Hey folks,

When a user is added to a new group, the user has to be log out and log in again to make the new group effective. Is there any system command or technique to refresh user group ID update without re-login?

I am not talking about to use "login" or "su -l" commands which can only make it effective in the terminal when the re-login command is running.

What I am looking for is a set of system commands which can refresh the user group IDs across the current login environment. Or it is not possible to add new group without re-login?

Thank you.

Kind regards.

As the user that has been added to a new group issue:

$ newgrp <new_group>

Change back to your primary group

$ newgrp

Test

$ groups
1 Like

Hmm, works for local authentication, but does not work for LDAP authentication, a little bit tricky .....