Network Information Service (NIS) B.11.31.04 Administrator's Guide
NOTE: Back up the /etc/passwd file before you perform the steps described in this
section.
1. Log in to the NIS master server as a superuser.
2. Create a new directory:
# cd /etc
# mkdir nis
3. Copy the /etc/passwd file from each host, including the NIS master server, in
your NIS domain as /etc/nis/passwd.hostname, to the host designated at
the master server.
where:
hostname specifies the name of the host to which the file belongs.
For example, for a host ocelot, the password file will be named as /etc/nis/
passwd.ocelot.
4. Concatenate all the passwd files, including the master server’s passwd file, to a
temporary passwd file:
# cd /etc/nis
# cat passwd passwd.hostname1 passwd.hostname2 passwd.temp
5. Sort the temporary passwd file by user name:
# sort -o /etc/nis/passwd.temp -t: -k1,1 /etc/nis/passwd.temp
NOTE: The NIS master server does not require the passwd file to be sorted on
any of the fields. However, sorting the passwd file facilitates the search for
duplicate entries.
6. Examine the /etc/nis/passwd.temp file, and remove any duplicate entries for
the same user name.
NOTE: Ensure that each user in the network has a unique user name.
7. Sort the passwd.temp file by user ID:
# sort -o /etc/nis/passwd.temp -t: -k3n,3 /etc/nis/passwd.temp
8. Examine the /etc/nis/passwd.temp file, and remove the duplicate entries of
user IDs.
NOTE: Ensure that no two users in the network have the same user ID.
9. Move the sorted /etc/nis/passwd.temp file to the /etc/passwd file.
The /etc/passwd file is used to generate the passwd map for the NIS domain
unless the private passwd file is used as source.
26 Configuring and Administering an NIS Master Server