[ Pobierz całość w formacie PDF ]
.This is why Sun developed the Network Information System (NIS).NIS provides generic database access facili-ties that can be used to distribute, for example, information contained in the passwd and groups files to all hostson your network.This makes the network appear as a single system, with the same accounts on all hosts.Simi-larly, you can use NIS to distribute the hostname information from /etc/hosts to all machines on the network.NIS is based on RPC, and comprises a server, a client-side library, and several administrative tools.Originally,NIS was called Yellow Pages, or YP, which is still used to refer to it.Unfortunately, the name is a trademark ofBritish Telecom, which required Sun to drop that name.As things go, some names stick with people, and so YPlives on as a prefix to the names of most NIS-related commands such as ypserv and ypbind.Today, NIS is available for virtually all Unixes, and there are even free implementations.BSD Net-2 releasedone that has been derived from a public domain reference implementation donated by Sun.The library clientcode from this release had been in the Linux libc for a long time, and the administrative programs were ported toLinux by Swen Th[UNHANDLED SDATA: [uuml ]]mmler.73 An NIS server is missing from the reference im-plementation, though.Peter Eriksson developed a new implementation called NYS.74 It supports both plain NIS and Sun's much en-hanced NIS+.NYS not only provides a set of NIS tools and a server, but also adds a whole new set of libraryfunctions that need to be compiled into your libc if you wish to use it.This includes a new configuration schemefor hostname resolution that replaces the current scheme using host.conf.The GNU libc, known as libc6 in the Linux community, includes an updated version of the traditional NIS sup-port developed by Thorsten Kukuk.75 It supports all of the library functions that NYS provided and also uses theenhanced configuration scheme of NYS.You still need the tools and server, but using GNU libc saves you thetrouble of having to meddle with patching and recompiling the library.This chapter focuses on the NIS support included in the GNU libc rather than the other two packages.If you dowant to run any of these packages, the instructions in this chapter may or may not be enough.For additionalinformation, refer to the NIS-HOWTO or a book such as Managing NFS and NIS by Hal Stern (O'Reilly).Getting Acquainted with NISNIS keeps database information in files called maps, which contain key-value pairs.An example of a key-valuepair is a user's login name and the encrypted form of their login password.Maps are stored on a central hostrunning the NIS server, from which clients may retrieve the information through various RPC calls.Quite fre-quently, maps are stored in DBM files.7673Swen can be reached at swen@uni-paderborn.de.The NIS clients are available as yp-linux.tar.gz from metalab.unc.edu in sys-tem/Network.74Peter may be reached at pen@lysator.liu.se.The current version of NYS is 1.2.8.75Thorsten may be reached at kukuk@uni-paderborn.de.76DBM is a simple database management library that uses hashing techniques to speed up search operations.There's a free DBM imple-mentation from the GNU project called gdbm, which is part of most Linux distributions.183The maps themselves are usually generated from master text files such as /etc/hosts or /etc/passwd.For somefiles, several maps are created, one for each search key type.For instance, you may search the hosts file for ahostname as well as for an IP address.Accordingly, two NIS maps are derived from it, called hosts.byname andhosts.byaddr.Table 13.1 lists common maps and the files from which they are generated.Table 13.1: Some Standard NIS Maps and Corresponding FilesMaster File Map(s) Description/etc/hostshosts.byname, hosts.byaddr Maps IP addresses to host names/etc/networksnetworks.byname, networks.byaddr Maps IP network addresses to network names/etc/passwd passwd.byname, passwd.byuid Maps encrypted passwords to user login names/etc/group group.byname, group.bygid Maps Group IDs to group namesMaps service descriptions to service names/etc/services services.byname, services.bynumber/etc/rpcrpc.byname, rpc.bynumber Maps Sun RPC service numbers to RPC servicenames/etc/protocolsprotocols.byname, proto- Maps protocol numbers to protocol namescols [ Pobierz całość w formacie PDF ]