revnetgroup Command
Purpose
Reverses the listing of users and hosts in network group files in NIS maps.
Syntax
Description
The revnetgroup command reverses the order in which hosts and users are listed in the /etc/netgroup file. The revnetgroup command is called from the /var/yp/Makefile file to produce output for creating either the netgroup.byuser or netgroup.byhost NIS map. Each line in the output file begins with a key formed by concatenating the host or user name with the domain name. Following the key is a list of groups to which the host or user belongs. The list is preceded by a tab, and each group is separated by a comma.
Note: The list of groups does not use the names of universal groups (groups that include all users in the network). Universal groups are listed under * (asterisk).
The revnetgroup command takes an optional file name if the default /etc/netgroup file is not desired. This feature provides users with flexibility to create custom network group maps.
Flags
Item | Description |
---|---|
-h | Produces output for creating the netgroup.byhost map. |
-u | Produces output for creating the netgroup.byuser map. |
Examples
- To cause the /etc/netgroup file
to list user names before host names, modify the appropriate stanza
in the /var/yp/Makefile to read:
revnetgroup -u
- To create a new network
group file, called newgroup, in the /etc directory,
modify the appropriate stanza in the /var/yp/Makefile to read:
The -h flag used in this example causes the new /etc/newgroup file to list host names before user names.revnetgroup -h newgroup
Files
Item | Description |
---|---|
/etc/netgroup | Contains lists of users and hosts in network groups. |
/var/yp/Makefile | Contains rules for making NIS maps. |