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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

ubuntu-users mailing list
Hi all:

I am actually using Kubuntu 16.04.4, but I believe this question has to
do with the Ubuntu base, therefore I am asking in this mailing list.

I have been using this system for years without problems. I wanted to
run another Linux in a virtual machine, so I installed VirtualBox, and I
saw severe memory leaks in Xorg which brought the system down. So I
decided to try virt-manager instead.

Up installation, it did not work, I had to install additional libvirt
and Qemu packages, until it did work. I had done it before on another
system, at that time an Xubuntu 16.04.4. I noticed at the time that
installing those packages added groups 'libvirtd' and 'kvm' to /etc/group .

I found it unfortunate that the installer (Synaptic) did not warn me
that I had to log out and in again. I expected that everything would
work straight away, but my user account was not immediately a member of
those groups. I guess that this is a limitation of the underlying Debian
APT system. In any case, I did realise, and after a system restart,
everything worked properly. Unfortunately, I do not have access to that
Xubuntu system anymore.

I repeated the same on my Kubuntu system, and everything worked the
same. But after a couple of days, I noticed problems everywhere. The
reason is that my user account was only member of 1 group (with the same
username), and was not a member of any of the other usual groups. That
is what I mean:


$ groups
rdiez

$ groups $USER
rdiez : rdiez adm tty dialout cdrom sudo dip plugdev fuse lpadmin
sambashare wireshark libvirtd

If I go through "su", group membership is fine again:

$ su - "$USER"
$ groups
rdiez adm tty dialout cdrom sudo dip plugdev fuse lpadmin sambashare
wireshark libvirtd


This discrepancy is apparently nothing surprising, for it is described here:

https://superuser.com/questions/294650/why-is-the-output-from-groups-different-from-groups-user-if-im-currently-log

https://serverfault.com/questions/339983/output-of-groups-different-then-id

However, I did not have this problem before, and it is becoming a pain.

I do not know if KVM/Qemu is the really the cause (it is only a
suspicion), or it is something else, like the latest system updates.

I guess that the login manager / SystemD / whatever is not handling
group membership correctly, even though "su" can. I would like to know
how I can "debug" my system to restore it to the previous state, where
my account was member of all groups right from the start.


Please copy me on all the answers, for I am not subscribed to this
mailing list.

Thanks in advance,
   rdiez


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Karl Auer
On Fri, 2018-07-20 at 11:35 +0200, R. Diez via ubuntu-users wrote:
> I found it unfortunate that the installer (Synaptic) did not warn me 
> that I had to log out and in again. I expected that everything would 
> work straight away, but my user account was not immediately a member
> of those groups. I guess that this is a limitation of the underlying
> Debian APT system.

I've never used a Unix (and I've used quite a few) where you could
modify groups and the changes would apply without logging out and back
in.

> $ groups
> rdiez
>
> $ groups $USER
> rdiez : rdiez adm tty dialout cdrom sudo dip plugdev fuse lpadmin 
> sambashare wireshark libvirtd

From "man groups":

   "Print group memberships for each USERNAME or, 
    if no USERNAME is specified, for the current
    process (which may differ if the groups
    database has changed)."

> If I go through "su", group membership is fine again:

Of course, because it is a new login shell.

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?

If so, posting your passwd and group files (sanitised please!) might
reveal the problem.

Or are you saying that you expect, on a new install, for your user ID
to automatically be a member of certain groups by default, and you are
disappointed that the set of groups you are in by default is not the
set you expected?

As far as me emailing you personally because you can't be bothered to
participate in the group - no. You'll get this answer when you check
the archives I guess. In the meantime, maybe it will help someone
else.

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
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



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Ralf Mardorf-2
On Fri, 20 Jul 2018 20:26:34 +1000, Karl Auer wrote:
>As far as me emailing you personally because you can't be bothered to
>participate in the group - no. You'll get this answer when you check
>the archives I guess.

Hi rdiez,

consider to either subscribe to the mailing list or to read the archive.

While Cc'ing on an open mailing list or a developer mailing list
sometimes is wanted, it usually only is done sometimes on developer
mailing lists for a good reason, but usually even frowned upon on open
mailing lists, let alone mailing lists that require subscription.

During last night I had a dispute on the Linux audio user mailing list,
because a subscriber replies to me directly, too, instead of only
replying to the mailing list, for no good reason, so I won't discuss
this all again.

Karl has got my full acknowledge!

However, just this once I'll send a mail directly to you, too. I wont
do again!

Here is the link to Karl's reply:

https://lists.ubuntu.com/archives/ubuntu-users/2018-July/294511.html

This is the link to the full archive:

https://lists.ubuntu.com/archives/ubuntu-users/

Regards,
Ralf


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

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

Tom H-4
In reply to this post by ubuntu-users mailing list
On Fri, Jul 20, 2018 at 11:37 AM R. Diez via ubuntu-users
<[hidden email]> wrote:

>>
> I am actually using Kubuntu 16.04.4, but I believe this question has to
> do with the Ubuntu base, therefore I am asking in this mailing list.
>
> I have been using this system for years without problems. I wanted to
> run another Linux in a virtual machine, so I installed VirtualBox, and I
> saw severe memory leaks in Xorg which brought the system down. So I
> decided to try virt-manager instead.
>
> Up installation, it did not work, I had to install additional libvirt
> and Qemu packages, until it did work. I had done it before on another
> system, at that time an Xubuntu 16.04.4. I noticed at the time that
> installing those packages added groups 'libvirtd' and 'kvm' to /etc/group .
>
> I found it unfortunate that the installer (Synaptic) did not warn me
> that I had to log out and in again. I expected that everything would
> work straight away, but my user account was not immediately a member of
> those groups. I guess that this is a limitation of the underlying Debian
> APT system. In any case, I did realise, and after a system restart,
> everything worked properly. Unfortunately, I do not have access to that
> Xubuntu system anymore.
>
> I repeated the same on my Kubuntu system, and everything worked the
> same. But after a couple of days, I noticed problems everywhere. The
> reason is that my user account was only member of 1 group (with the same
> username), and was not a member of any of the other usual groups. That
> is what I mean:
>
> $ groups
> rdiez
>
> $ groups $USER
> rdiez : rdiez adm tty dialout cdrom sudo dip plugdev fuse lpadmin
> sambashare wireshark libvirtd
>
> If I go through "su", group membership is fine again:
>
> $ su - "$USER"
> $ groups
> rdiez adm tty dialout cdrom sudo dip plugdev fuse lpadmin sambashare
> wireshark libvirtd
>
> This discrepancy is apparently nothing surprising, for it is described here:
>
> https://superuser.com/questions/294650/why-is-the-output-from-groups-different-from-groups-user-if-im-currently-log
>
> https://serverfault.com/questions/339983/output-of-groups-different-then-id
>
> However, I did not have this problem before, and it is becoming a pain.
>
> I do not know if KVM/Qemu is the really the cause (it is only a
> suspicion), or it is something else, like the latest system updates.
>
> I guess that the login manager / SystemD / whatever is not handling
> group membership correctly, even though "su" can. I would like to know
> how I can "debug" my system to restore it to the previous state, where
> my account was member of all groups right from the start.

Everything's handling group membership correctly.

If you're logged in when you're added to a group, you must either log
out and log back in or use "newgrp" to add that group to your
effective list of groups.

I don't think that a dpkg- or rpm-based distro's post-install scripts
can add a group to an already-logged-in user's effective list of
groups. It has to be done within that user's session.


> Please copy me on all the answers, for I am not subscribed to this
> mailing list.

Subscribe!

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users