NFS Services Administrator's Guide
Configuring and Administering NFS
Configuring and Using NFS Netgroups
Chapter 2130
Using Netgroups in the /etc/passwd File
In the /etc/passwd file, netgroups can be used to indicate whether user
information should be looked up in the NIS or NIS+ passwd database.
The following example line from the /etc/passwd file indicates that
users in the netgroup animals should be looked up in the NIS or NIS+
passwd database:
+@animals
The animals netgroup is defined as follows in the /etc/netgroup file:
animals (-,mickey, ), (-,daffy, ), (-,porky, ), (-,bugs, )
Note that the /etc/passwd file is searched sequentially, so if user
mickey, daffy, porky, or bugs appears before the animals netgroup in
the /etc/passwd file, the NIS or NIS+ database will never be consulted
for information on that user.
The Name Service Switch configuration is used to determine where to
look for the contents of a netgroup. See “Configuring the Name Service
Switch” on page 267.
Netgroups can also be used to prevent lookups of certain users in the NIS
or NIS+ passwd database. The following example lines from the
/etc/passwd file indicate that if the NIS or NIS+ passwd database
contains entries for users in the bears netgroup, these entries cannot be
used on the local system. Any other users can be looked up in the NIS or
NIS+ database.
-@bears
+::-2:60001:::
The line beginning with + causes the NIS or NIS+ database to be
searched for any users (except those in the bears netgroup) who are not
listed before the line beginning with +.
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/passwd file, type man 4 passwd at the
HP-UX prompt.