Downloading and installing RPMs isn't hard, as discussed in Chapter 6, "Installing Linux Software".When searching for the RPMs, remember that the filename usually starts with the software package name followed by a version number, as in yp-tools-2.8-3.i386All the packages required for NIS clients are a standard part of most Fedora installations. Install the package according to the steps outlined in Chapter 6,"Installing Linux Software". [[email protected] tmp]# service ypxfrd start Starting YP map server: [ OK ] [[email protected] tmp]# chkconfig ypbind on [[email protected] tmp]# chkconfig ypxfrd on [[email protected] tmp]# rpcinfo -p localhost program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100003 nfs 100003 nfs 100021 nlockmgr 100021 nlockmgr 100021 nlockmgr 100004 2 udp 784 ypserv 100004 1 udp 784 ypserv 100004 2 tcp 787 ypserv 100004 1 tcp 787 ypserv 100009 1 udp 798 yppasswdd 600100069 1 udp 850 fypxfrd 600100069 1 tcp 852 fypxfrd 100007 2 udp 924 ypbind 100007 1 udp 924 ypbind 100007 2 tcp 927 ypbind 100007 1 tcp 927 ypbind [[email protected] tmp]# New NIS users can be created by logging into the NIS server and creating the new user account.You need to add the NIS domain you wish to use in the /etc/sysconfig/network file. In this case, you'll create a user account called nisuser and give it a new password.Edit the /etc/exports file to allow NFS mounts of the /home directory with read/write access.
An advantage of NIS is that users need to change their passwords on the NIS server only, instead of every system on the network.To understand the benefits of NFS, consider an example.A school wants to set up a small computer lab for its students.All newly added Linux users will now be assigned a home directory under the new remote /home directory. Now you can run ypinit -s bigboy on all slave server.This scheme will make the users feel their home directories are local, when in reality they are automatically mounted and accessed over your network. You now have to configure NIS login authentication for the lab students before the job is done. [[email protected] tmp]# You will have to delete the /var/yp/NIS-SCHOOL-NETWORK directory and restart portmap, yppasswd, and ypserv before you'll be able to do this again successfully.For the school, call the domain NIS-SCHOOL-NETWORK. Once this is complete, you then have to update the NIS domain's authentication files by executing the make command in the /var/yp directory.[[email protected] tmp]# service portmap start Starting portmapper: [ OK ] [[email protected] tmp]# service yppasswdd start Starting YP passwd service: [ OK ] [[email protected] tmp]# service ypserv start Setting NIS domain name NIS-SCHOOL-NETWORK: [ OK ] Starting YP server services: [ OK ] [[email protected] tmp]# [[email protected] tmp]# chkconfig portmap on [[email protected] tmp]# chkconfig yppasswdd on [[email protected] tmp]# chkconfig ypserv on [[email protected] tmp]# rpcinfo -p localhost program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100009 1 udp 681 yppasswdd 100004 2 udp 698 ypserv 100004 1 udp 698 ypserv 100004 2 tcp 701 ypserv 100004 1 tcp 701 ypserv [[email protected] tmp]# The ypbind and ypxfrd daemons won't start properly until after you initialize the NIS domain. This procedure makes all NIS-enabled, nonprivileged accounts become automatically accessible via NIS, not just newly created ones.You will be prompted for the name of the NIS server, which in this case is bigboy. New password: Retype new password: passwd: all authentication tokens updated successfully. gmake: Leaving directory `/var/yp/NIS-SCHOOL-NETWORK' [[email protected] yp]# You can also use the getent command, which has similar syntax.With this procedure, all nonprivileged accounts are automatically accessible via NIS. [[email protected] tmp]# cd /var/yp [[email protected] yp]# make gmake: Entering directory `/var/yp/NIS-SCHOOL-NETWORK' Updating passwd.byname... Unlike ypmatch, getent doesn't provide an encrypted password when run on an NIS server, it just provides the user's entry in the /etc/passwd file.Note: This automounter feature doesn't appear to function correctly in my preliminary testing of Fedora Core 3.See Chapter 29, "Remote Disk Access with NFS", for details. gmake: Leaving directory `/var/yp/NIS-SCHOOL-NETWORK' bigboy has been set up as a NIS master server.