1

Recently I noticed strange thing that I can't figure out searching the web.

The groups and id give

$ groups 
q
$ id
uid=1000(q) gid=1000(q) groups=1000(q)

But explicitly passed arg change the result

$ groups q
q : q adm tty disk lp uucp dialout cdrom sudo audio dip video plugdev 
users lpadmin pulse pulse-access sambashare vboxusers input wireshark docker libvirt

$ id q
uid=1000(q) gid=1000(q) groups=1000(q),4(adm),5(tty),6(disk),7(lp),10(uucp),20(dialout),24(cdrom),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),108(lpadmin),122(pulse),123(pulse-access),124(sambashare),125(vboxusers),148(input),153(wireshark),155(docker),160(libvirt)

From man

SYNOPSIS

id [OPTION]... [USER]

DESCRIPTION

Print user and group information for the specified USER, or (when USER omitted) for the current user.

After

$ sudo -i -u q

$ groups
q adm tty disk lp uucp dialout cdrom sudo audio dip video plugdev users lpadmin pulse pulse-access sambashare vboxusers input wireshark docker libvirt
$ id
uid=1000(q) gid=1000(q) groups=1000(q),4(adm),5(tty),6(disk),7(lp),10(uucp),20(dialout),24(cdrom),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),108(lpadmin),122(pulse),123(pulse-access),124(sambashare),125(vboxusers),148(input),153(wireshark),155(docker),160(libvirt)

This issue has side effect regarding to file system items access. Apps like VirtualBox can't get access to e.g. /dev/vboxusb until sudo -i -u q.

I'm on Ubuntu 18.04 LTS. How to fix?

0

You must log in to answer this question.

Browse other questions tagged .