I am closing this bug invalid -- this is expected (and correct) behaviour. Runing 'id' without no parameters will cause the program to issue get[e]uid()/getg[e]id() -- which is to say, find out what are the currently valid users and groups.
Running 'id auser' makes it issue a getpwnam(auser) -- which is to say, it will read /etc/passwd to get the data. So... you get what is in the /etc/passwd, not necessarily what is active. Groups are set when an user logs in, and are not dynamically updated when you add in a new group to the account. Running 'bash -l' makes bash start as if it were a new login -- but it is still the same session, so still the same original groups. This is different from a ssh session, where a real new session is started. You can always use 'newgrp <whatever group you want>' to move to the new group you added -- but two things should be kept in mind: 1. 'newgrp <whatever>' will fire off a new bash, where your environment will now be set with this new group as the current (effective) group; if you do not want to stack shells, you should use 'exec newgrp <whatever>' 2. This change will be valid for this shell environment, not for the rest of your logged in environment. This is how *IX has been for as long as I can remember. If there is a bug (it would actually be more like a wishlist), it is certainly not in 'id'... perhaps in PAM? Anyway -- thank you for reporting this bug (even if it ended up as NOTABUG) -- this is a quite arcane bevahiour, and may seem counterintuitive to a lot of people, and I hope my explanation may help. Of course, if you do not agree, please feel free to reopen. ** Changed in: coreutils (Ubuntu) Status: Confirmed => Invalid -- Strange behavior after adding a user to a certain group, groups and id don't show updates https://bugs.launchpad.net/bugs/178059 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs