The Group Database

The previous section covered library functions that work with the password database. Functions that search the group database will be covered in this section.

The /etc/group File

The group database has traditionally been a simple text file /etc/group. Its format is similar to the password database, and a small example is as follows:

root::0:root
bin::1:root,bin,daemon
daemon::2:root,bin,daemon
sys::3:root,bin,adm
adm::4:root,adm,daemon,wwg
lp::7:lp
mem::8:
kmem::9:
mail::12:mail
news::13:news
uucp::14:uucp
man::15:man
users::100:student1,jan
postgres::102:wwg
nogroup::-1:
nobody::-1:

The format of the group database is illustrated in Table 12.5.

Table 12.5. The Group Database Fields
Field Example Description
1 users Group ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.