Article 57GH9 [SOLVED] How am I a member of groups such as 'floppy', 'audio', and 'scanner'?

[SOLVED] How am I a member of groups such as 'floppy', 'audio', and 'scanner'?

by
ratfactor
from LinuxQuestions.org on (#57GH9)
I'm puzzled by this behavior of coreutils groups output:

Code:dave@europa~$ groups dave
dave : users wheel

dave@europa~$ groups
users lp wheel floppy audio video cdrom scannerWhy does the current process belong to more groups than my user?

The two groups I'd expect from the explicit membership in /etc/passwd and /etc/group are users (primary) and wheel (supplementary):

Code:dave@europa~$ grep dave /etc/group
wheel:x:10:root,dave

dave@europa~$ grep dave /etc/passwd
dave:x:1000:100:,,,:/home/dave:/bin/bashI understand that running groups on its own gives me the group membership of the current process (inherited from my login shell). But I am not understanding the mechanism by which I'm being added to the additional "system" groups (lp floppy audio video cdrom scanner).

Commands such as getent and id tell me things I already know:

Code:dave@europa~$ getent group floppy users wheel
floppy:x:11:
users:x:100:
wheel:x:10:root,dave

dave@europa~$ id dave
uid=1000(dave) gid=100(users) groups=100(users),10(wheel)

dave@europa~$ id
uid=1000(dave) gid=100(users) groups=100(users),7(lp),10(wheel),11(floppy),17(audio),18(video),19(cdrom),93(scanner)My research has led to the source code of GNU coreutils groups, the man pages for NSS and nsswitch.conf, etc. I've read the relevant chunks from Michael Kerrisk's The Linux Programming Interface (which I thought would surely scare the problem into revealing itself!). :study:

Now I'm convinced I'm overlooking a super simple and obvious answer to this. :doh:

(As an amusing aside, I've noticed that all examples online carefully avoid this issue entirely.)latest?d=yIl2AUoC8zA latest?i=ikOl2zeXFKc:3ktwtmTAeTM:F7zBnMy latest?i=ikOl2zeXFKc:3ktwtmTAeTM:V_sGLiP latest?d=qj6IDK7rITs latest?i=ikOl2zeXFKc:3ktwtmTAeTM:gIN9vFwikOl2zeXFKc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments