1

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.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
millerthegorilla
  • 211
  • 1
  • 2
  • 5
  • 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? – millerthegorilla Mar 13 '19 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](https://askubuntu.com/questions/1059856/lost-supplementary-user-groups-for-gui-login-session/1059997#1059997) – steeldriver Mar 13 '19 at 14:44
  • have you tried `newgrp groupname` as this user? – Valentin Bajrami Mar 13 '19 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... – Romeo Kienzler Sep 06 '22 at 07:20

1 Answers1

0

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