Network Information Service (NIS) B.11.31.04 Administrator's Guide
Example 1
The following entry from a /var/yp/securenets file allows only the NIS client
at IP address 20.21.12.13 to request information from the NIS master server:
255.255.255.255 20.21.12.13
Each bit is set in the address mask. Only the host whose IP address is 20.21.12.13
is allowed access to the master server.
Example 2
The following entry from a /var/yp/securenets file allows hosts on the
20.21.12.13 network, to request NIS information or transfer NIS maps from the
master server:
255.255.255.0 20.21.12.13
The last eight bits in the IP address are ignored because the last eight bits of the
address mask are set to 0. Any host whose IP address begins with 20.21.12 is
allowed access to the master server.
NOTE: You must restart the ypserv process for the changes made to the /var/
yp/securenets file to be effective.
4. Restart the ypserv process:
# /sbin/init.d/nis.server stop
# /sbin/init.d/nis.server start
For more information, see securenets (4).
Verifying the Contents of an NIS Map
To verify the contents of an NIS map, enter the following command:
# /usr/bin/ypcat -k mapname
The -k option lists the key for each item in the map and the data associated with the
key.
For example, in the netgroup.byhost map, the hostname is the key. If the -k option is
not specified, the ypcat command lists all the data associated with each netgroup
name. However, it does not list key, the hostname in this case.
For more information about the ypcat command, see ypcat (1).
Modifying an NIS Map
System information such as new user account and password may have to be updated
periodically. You have to modify the /etc/hosts, /etc/passwd, and /etc/group
files on the NIS master server to update the NIS map regularly.
To modify an NIS map, complete the following steps:
1. Log in to the NIS master server as a superuser.
Verifying the Contents of an NIS Map 35