NFS Services Administrator's Guide

Configuring and Administering NFS
Configuring and Using NFS Netgroups
Chapter 2 131
Using Netgroups in the /etc/group File
In the /etc/group file, netgroups can be used to indicate whether group
information about certain users should be looked up in the NIS or NIS+
group database.
The following example line from the /etc/group file indicates that group
information for users in the netgroup animals can be found in the NIS or
NIS+ group database:
+@animals
The animals netgroup is defined as follows in the /etc/netgroup file:
animals (-,mickey, ), (-,daffy, ), (-,porky, ), (-,bugs, )
Members of the animals netgroup can belong to groups listed in the local
/etc/group file as well as in the NIS or NIS+ group database. The
following lines in the /etc/group file give users bugs and daffy
membership in the group wiseguys and in any group in the NIS or NIS+
database that includes them as members:
wiseguys::22:bugs,daffy
+@animals
Netgroups can also be used in the /etc/group file to prevent lookups for
certain users. The bears netgroup is defined as follows in the
/etc/netgroup file:
bears (-,yogi, ), (-,smokey, ), (-,pooh, )
The following lines in the /etc/group file allow user pooh membership
in group teddybears but not in any other group listed in the NIS or
NIS+ database or after the -@bears line in the /etc/group file:
teddybears::23:pooh,paddington
-@bears
For more information on NIS, see “Configuring and Administering NIS”
on page 145.
For more information on NIS+, see “Configuring and Administering
NIS+” on page 199.
For information on the /etc/group file, type man 4 group at the HP-UX
prompt.