- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
Configuring a NIS Secondary Server
After you've decided to configure a machine as a NIS secondary server, you start by configuring it as a NIS client machine. Verify that you can access the server maps via the ypcat command.
Now you are ready to tell the master server that a slave server exists. To do this, edit the /var/yp/ypservers file so that the slave server you are setting up is included in the list. Now make sure you are in /var/yp and then run a make. If you configured your master server with the name of the slave server during the ypinit -m phase, you do not need to do this.
On the slave server make sure that the ypserv daemon is installed. If it is not, you will need to install this from the RPM.
[root@client /root]# cd /mnt/cdrom/Redhat/RPMS [root@client RPMS]# rpm –I ypserv*
You will have to make the ypserv daemon start at boot time. The commands to do this are
[root@client /root]# cd /etc/rc3.d [root@client rc3.d]# ln –s ../init.d/ypserv S60ypserv
You can now initialize the slave server by running the command
/usr/lib/yp/ypinit -s master
master is the hostname for the NIS master server. In this example, it's vestax. The output should look something like the following:
We will need some minutes to copy the databases from vestax. Transferring mail.aliases... Trying ypxfrd ... not running Transferring services.byname... Trying ypxfrd ... not running Transferring rpc.bynumber... Trying ypxfrd ... not running [etc...] denon.domain.com's NIS database has been set up. If there were warnings, please figure out what went wrong, and fix it. At this point, make sure that /etc/passwd and /etc/group have been edited so that when the NIS is activated, the databases you have just created will be used, instead of the /etc ASCII files.
Don't worry about the Trying ypxfrd...not running message. This happens because you haven't set the NIS master server to run the YP map transfer daemon rpc.ypxfrd. In fact, you never set it up to do so; instead, use a server push method where the NIS master server pushes the maps to all the NIS slaves whenever there is an update.
To set the NIS master to do the actual push, you need to change its makefile a little. On the master server, edit the makefile so that the line NOPUSH="True" is changed to read NOPUSH="false" and the line that reads DOMAIN = 'basename \'pwd\'' is changed to DOMAIN = '/bin/domainname'.
Now for the big test: On the NIS master server, run cd /var/yp;make all to force all the maps to be rebuilt and pushed. The output should look something like the following:
Updating passwd.byname.... Pushed passwd.byname map. Updating passwd.byuid... Pushed passwd.byuid map. Updating hosts.byname... Pushed hosts.byname. Updating hosts.byaddr... Pushed hosts.byaddr. [etc...]
If you get an error like the following:
Could not read ypservers map: 3 Can't bind to server which serves this domain
you will have to set up the master server as a client also. Change the /etc/yp.conf file to point to the server, in this case vestax.audionet.domain.com. Add an entry to the /etc/sysconfig/network file such as NISDOMAIN=nisdomain where nisdomain is your domain, in this example audionet.domain.com. Don't forget to start the ypbind daemon also.
On the NIS slave server, change the /etc/yp.conf file so that the ypserver is set to point to the slave server. Run the command ypcat passwd and see whether your NIS password file is displayed. If so, you're set. The NIS slave server is configured.
If you're having problems, trace through your steps. Also be sure to reboot the machine and see if your NIS slave server still works correctly. If it doesn't come back up, be sure that the changes you made to the boot sequence when installing ypserv were correct.
Using NISisms in Your /etc/passwd File | Next Section

Account Sign In
View your cart