git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Output from 'groups' is suddently different to /etc/group


On Fri, 2018-07-20 at 15:09 +0200, R. Diez wrote:
> I expected that everything would work straight away, but my user
> account was not immediately a member of those groups.

Yeah, I can see you might be surprised, but it's just one of those
things. The process that you are running in gets given the permissions
the system knows about when you log in. It can't be given extra
permissions afterwards, so you need to create a new process with the
new permissions. That's what you do with newgrp, by the way - it
actually creates a new shell with membership of the specified group.

> Yes, but how would I know that the package I just installed has
> changed group membership? Or should I assume the worst and restart my
> system after installing every package, like on Windows?

You don't need to reboot - you just need to log out and back in.

>  > I'm not sure what your actual problem is. Are you saying that
>  > the above situation persists even after logging out and
>  > back in, or even after e.g. a reboot?
> 
> Yes. I have rebooted a few times in the meantime, and the problem is 
> still there.

So - even after rebooting and logging in again, when you run "groups"
it only shows you as a member of "rdiez", and not a member of all those
other groups? That is definitely NOT what should happen.

This sequence is what SHOULD happen. This is in a terminal window after
I have logged into X as "kauer":

kauer at kt:~$ sudo addgroup bippity
Adding group `bippity' (GID 1002) ...
Done.
kauer at kt:~$ groups
kauer adm dialout [...etc...]
kauer at kt:~$ groups kauer
kauer : kauer adm dialout [...etc...]
kauer at kt:~$ sudo usermod -a -G bippity kauer
kauer at kt:~$ groups
kauer adm dialout [...etc...]
kauer at kt:~$ groups kauer
kauer : kauer adm dialout [...etc...] bippity
kauer at kt:~$ newgrp bippity
kauer at kt:~$ groups
bippity adm dialout [...etc...] kauer
kauer at kt:~$ exit
exit
kauer at kt:~$ groups
kauer adm dialout [...etc...]
kauer at kt:~$ su - kauer
Password: 
kauer at kt:~$ groups
kauer adm dialout [...etc...] bippity
kauer at kt:~$ exit
logout
kauer at kt:~$ groups
kauer adm dialout [...etc...]
kauer at kt:~$ sudo delgroup bippity
Removing group `bippity' ...
Done.

> I would like to know who is setting up the group membership when
> logging in, so that I can try to debug the problem there.
>  "su - $USER" obviously does it differently.

Not really - the "-" just means do a full login.

This may be a silly question, but are you actually logging in as rdiez?
Into your window manager or a console?

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A0CD 28F0 10BE FC21 C57C 67C1 19A6 83A4 9B0B 1D75
Old fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A






( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/ubuntu-users/msg37843.html on line 153
Call Stack
#TimeMemoryFunctionLocation
10.0011368472{main}( ).../msg37843.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/ubuntu-users/msg37843.html on line 153
Call Stack
#TimeMemoryFunctionLocation
10.0011368472{main}( ).../msg37843.html:0