LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-29-2020, 11:12 AM   #1
ratfactor
LQ Newbie
 
Registered: Aug 2019
Distribution: Slackware
Posts: 8

Rep: Reputation: Disabled
Question How am I a member of groups such as 'floppy', 'audio', and 'scanner'?


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 scanner
Why 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/bash
I 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!).

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

(As an amusing aside, I've noticed that all examples online carefully avoid this issue entirely.)
 
Old 08-29-2020, 11:54 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 6,894
Blog Entries: 17

Rep: Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135Reputation: 4135
Look in the file /etc/login.defs. There is often a list of groups that the login program adds everyone to.
 
6 members found this post helpful.
Old 08-29-2020, 12:22 PM   #3
ratfactor
LQ Newbie
 
Registered: Aug 2019
Distribution: Slackware
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
Look in the file /etc/login.defs. There is often a list of groups that the login program adds everyone to.
That's it! I'd even skimmed man login and man login.defs (described as "Shadow password suite configuration"), but had missed CONSOLE_GROUPS.

Code:
$ grep floppy /etc/login.defs 
CONSOLE_GROUPS         floppy:audio:cdrom:video:lp:scanner
After the fact, I also realized I probably could have found it like so with The Silver Searcher:

Code:
$ sudo ag floppy /etc | ag cdrom
/etc/login.defs:374:CONSOLE_GROUPS         floppy:audio:cdrom:video:lp:scanner
Thanks, Hazel!
 
  


Reply

Tags
group, groups


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
groups within groups and sshd_config allow_groups td3201 Linux - Server 6 07-25-2009 09:43 AM
System Groups from Users and Groups measekite Linux - General 3 05-05-2009 09:22 PM
limit to nesting groups within groups? geekgrl Linux - General 3 10-16-2007 11:50 AM
winbind: wbinfo -g only lists global groups from PDC and not local groups saradiya Linux - Networking 0 12-01-2003 02:58 AM
Groups members of other groups bentz Linux - Security 6 06-22-2003 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration