I used groupadd to add a group so that I could manage with git some root owned scripts. I then used usermod to add a user to a group. The user is the currently logged in standard user and I am in a shell through su into the superuser account in the terminal. I logged out and logged back in again, having run

sudo usermod -aGgroupname username

as I always have done. After I logged back in as the standard user, the command groups continued to show just the user, but when I logged in to the superuser account and ran

groups stdusername

the output showed that the std user is a member of the new group. I don't understand how this can happen.

  • I've just run 'groups username' from the std user account and it shows the added group. So why does the command 'groups' only show the user's own group? Mar 13, 2019 at 14:37
  • Does groups show any supplementary groups? if not, check if a buggy kwallet pam module is involved - see Lost supplementary user groups for GUI login session Mar 13, 2019 at 14:44
  • have you tried newgrp groupname as this user? Mar 13, 2019 at 15:51
  • Same problem here: /// cat /etc/group => docker:x:975:romeokienzler /// groups romeokienzler => romeokienzler : romeokienzler wheel libvirt docker /// id => uid=1000(romeokienzler) gid=1000(romeokienzler) groups=1000(romeokienzler),10(wheel),984(libvirt) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 /// ls -lahr /var/run/docker.sock => srw-rw----. 1 root docker 0 Sep 6 09:12 /var/run/docker.sock /// docker ps Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/cont... Sep 6, 2022 at 7:20

1 Answer 1


Did you reboot / re-login?

sudo pkill -SIGKILL -u ${USER}

did the job for me as desrcibed here

Seems to be a feature of Fedora - not happening on Ubuntu

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .