4

After the apt-get update and apt-get upgrade run few days ago, user groups are not applied properly to the currently logged-in user.

I can see all the groups being properly saved in the /etc/passwd and /etc/groups but after the system restart only the default user group is being applied. I don't see any particular errors in syslog.

After system startup only the default group is being applied to the user.

user@localhost:~$ id
uid=1000(user) gid=1000(user) groups=1000(user)

Though, when listing available groups they're visible but not currently attached to the session.

user@localhost:~$ id user
uid=1000(user) gid=1000(user) groups=1000(user),4(adm),27(sudo),999(docker)

I need to manually login as the same user every time new shell session is created, then it works as expected.

user@localhost:~$ su user
user@localhost:~$ id
uid=1000(user) gid=1000(user) groups=1000(user),4(adm),27(sudo),999(docker)

Any ideas what could caused this?


I have already tried:

  • Log out / in
  • Recreate groups
  • Reassign groups to the user

As a bonus I can mention that the newgrp behaves weird and it switches the main group instead of registering it with the others:

user@localhost:~$ newgrp docker
user@localhost:~$ id
uid=1000(user) gid=999(docker) groups=999(docker)

Thanks!

2 Answers 2

4

I was having the same problem (xfce, Ubuntu 16.04 LTS). A report on the lightdm bug tracker suggests removing/commenting out two lines in /etc/pam.d/lightdm, specifically:

auth optional pam_kwallet.so
auth optional pam_kwallet5.so

should become:

#auth optional pam_kwallet.so
#auth optional pam_kwallet5.so

This worked for me! I'm guessing that this might have some effect on auto-unlocking of your KWallet at login, if that's relevant.

2
  • 1
    This also prevented the "logout" function of the GUI from working. I would select "logout" and the GUI would exit and then reload itself, leaving me logged into the console. Removed those 2 from pam.d/lightdm, and logout now works. Aug 20, 2018 at 15:06
  • This fixed it for me, that bug still seems to be current in 2019.
    – Nick
    Jun 25, 2019 at 9:26
0

A processes's group membership is set up once at login time, by login. The system does not track the group file and modify existing processes.

You can start a process with new group membership info with the newgrp command. Read man newgrp

1
  • Thanks, that's correct. Though I'm looking for a reason why after the system starts groups are not loaded properly. I can manually fix it by logging in as current user with su user. This is annoying as I need to do this every time new shell window is open. Before the packages update it worked as expected and all groups were loaded properly. I do expect this is some configuration error that happened during the packages upgrade though can not locate the source of the problem.
    – Mr.Coffee
    Jul 19, 2018 at 8:21

You must log in to answer this question.

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