NFS Services Administrator's Guide
Configuring and Administering NIS
Configuring and Administering an NIS Master Server
Chapter 4 155
To Create the Master passwd File
1. Copy the /etc/passwd file from each host in your NIS domain to the
/etc directory on the host that will be the master server. Name each
copy /etc/passwd.hostname, where hostname is the name of the
host it came from.
2. Concatenate all the passwd files together, including the master
server’s passwd file, into a temporary passwd file, as follows:
cd /etc
cat passwd passwd.hostname1 passwd.hostname2... >
passwd.temp
3. Issue the following command to sort the temporary passwd file by
user name:
sort -o /etc/passwd.temp -t: -k1,1 /etc/passwd.temp
4. Examine /etc/passwd.temp for duplicate user names. If you find
multiple entries for the same user, edit the file to remove redundant
ones. Make sure each user in your network has a unique user name.
5. Issue the following command to sort the temporary passwd file by
user ID:
sort -o /etc/passwd.temp -t: -k3n,3 /etc/passwd.temp
6. Examine /etc/passwd.temp for duplicate user IDs. If you find
multiple entries with the same user ID, edit the file to change the
user IDs so that no two users have the same user ID.
7. Move /etc/passwd.temp (the sorted, edited file) to /etc/passwd.
This file will be used to generate the passwd map for your NIS
domain.
8. Remove all the /etc/passwd.hostname files from the master server.
NOTE NIS does not require that the passwd file be sorted in any particular way.
Sorting the passwd file simply makes it easier to find duplicate entries.
For more information, type man 4 passwd or man 1 sort at the HP-UX
prompt.