0

I have a GID which is present in the getent database but not in /etc/group :

$ getent group 61876 
earlyoom:x:61876:

$ cat /etc/group | grep earlyoom
$

Is it normal or should I worry ? Shouldn't they have matching results ?

edit : fedora 32

John Doe
  • 125
  • 1
  • 7

1 Answers1

1

getent uses nss, not directly the file. Look at /etc/nsswitch.conf on line beginning with group:

Ipor Sircer
  • 1,226
  • 7
  • 8
  • I have this line : "group: sss files systemd" in /etc/nsswitch.conf but that does not answer my question : this file is used to tell where getent should search isn't it ? What I am looking for is the reason of the mismatch. Unless I don't understand what you mean.. Which is possible. – John Doe Aug 26 '20 at 09:59
  • That is the reason. getent search for group with sss first, then files (/etc/group), then systemd. Your group comes from sss or systemd. – Ipor Sircer Aug 26 '20 at 10:00
  • But /etc/group isn't supposed to have ALL groups listed then ? I thought so. – John Doe Aug 26 '20 at 10:01
  • 1
    If all groups was in /etc/group, there was no need for GNU Name Service Switch, which read account data from various places, and /etc/group is only one of them. There are a tons of extensions for nss, for reading account from mysql, ldap, sqlite, etc... – Ipor Sircer Aug 26 '20 at 10:06