1

I am using Red Hat Linux 6. Have a username 'nrajora' and a group name 'nrajora' as default in the system

I created a new group 'super-group' which has all the required privileges.

Now I am trying to add the 'super-group' to my user 'nrajora' but not able to.

Following is what I have tried:

whoami

nrajora

id

uid=1101(nrajora) gid=1101(nrajora) groups=1101(nrajora),1102(default)

sudo groupadd super-group
sudo usermod -a -G super-group nrajora
id

uid=1101(nrajora) gid=1101(nrajora) groups=1101(nrajora),1102(default)

Nothing changed after above usermod -a -G command.

sudo usermod -g super-group nrajora
id

uid=1101(nrajora) gid=1101(nrajora) groups=1101(nrajora),1102(default)

Nothing changed after usermod -g either.

Whereas when I specify the group name to id, it shows me the groups being added.

id nrajora

uid=1101(nrajora) gid=1104(super-group) groups=1104(super-group),1102(default)

Can someone tell me what am I doing wrong?

  • 5
    You might need to log out and back in in order for id to pick up changes to the groups of a user. – Lucas Sep 30 '18 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.