home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 11 / IOPROG_11.ISO / docs / nis-ho~1 < prev    next >
Encoding:
Text File  |  1997-01-11  |  26.4 KB  |  667 lines

  1.   The Linux NIS(YP)/NIS+/NYS HOWTO
  2.   Andrea Dell'Amico, Mitchum DSouza, Erwin Embsen, Peter Eriksson
  3.   v0.6, 14 November 1996
  4.  
  5.   1.  Glossary of Terms
  6.  
  7.   In this document a lot of acronyms are used. Here are the most
  8.   important acronyms and a brief explanation:
  9.  
  10.      DBM
  11.         DataBase Management, a library of functions which maintain key-
  12.         content pairs in a data base.
  13.  
  14.      DLL
  15.         Dynamically Linked Library, a library linked to an executable
  16.         program at run-time.
  17.  
  18.      domainname
  19.         A name "key" that is used by NIS clients to be able to locate a
  20.         suitable NIS server that serves that domainname key. Please note
  21.         that this does not necessarily have anything at all to do with
  22.         the DNS "domain" (machine name) of the machine(s).
  23.  
  24.      FTP
  25.         File Transfer Protocol, a protocol used to transfer files
  26.         between two computers.
  27.  
  28.      libnsl
  29.         Name services library, a library of name service calls
  30.         (getpwnam, getservbyname, etc...) on SVR4 Unixes.
  31.  
  32.      libsocket
  33.         Socket services library, a library for the socket service calls
  34.         (socket, bind, listen, etc...) on SVR4 Unixes.
  35.  
  36.      NIS
  37.         Network Information Service, a service that provides
  38.         information, that has to be known throughout the network, to all
  39.         machines on the network. There is support for NIS in Linux's
  40.         standard libc library, which in the following text is referred
  41.         to as "traditional NIS".
  42.  
  43.      NIS+
  44.         Network Information Service (Plus :-), essentially NIS on
  45.         steroids. NIS+ is designed by Sun Microsystems Inc. as a
  46.         replacement for NIS with better security and better handling of
  47.         _large_ installations.
  48.  
  49.      NYS
  50.         This is the name of a project and stands for NIS+, YP and Switch
  51.         and is managed by Peter Eriksson <peter@ifm.liu.se>. It contains
  52.         among other things a complete reimplementation of the NIS (= YP)
  53.         code that uses the Name Services Switch functionality of the NYS
  54.         library.
  55.  
  56.      RPC
  57.         Remote Procedure Call. RPC routines allow C programs to make
  58.         procedure calls on other machines across the network.  When
  59.         people talk about RPC they most often mean the Sun RPC variant.
  60.  
  61.      YP Yellow Pages(tm), a registered trademark in the UK of British
  62.         Telecom plc.
  63.  
  64.      TCP-IP
  65.         Transmission Control Protocol/Internet Protocol. It's the data
  66.         communication protocol most often used on Unix machines.
  67.  
  68.   1.1.  Some General Information
  69.  
  70.   The next three lines are quoted from the Sun(tm) System & Network
  71.   Administration Manual:
  72.  
  73.            "NIS was formerly known as Sun Yellow Pages (YP) but
  74.             the name Yellow Pages(tm) is a registered trademark
  75.             in the United Kingdom of British Telecom plc and may
  76.             not be used without permission."
  77.  
  78.   NIS stands for Network Information Service. It's purpose is to provide
  79.   information, that has to be known throughout the network, to all
  80.   machines on the network. Information likely to be distributed by NIS
  81.   is:
  82.  
  83.   ╖  login names/passwords/home directories (/etc/passwd)
  84.  
  85.   ╖  group information (/etc/group)
  86.  
  87.   So, for example, if your password entry is recorded in the NIS passwd
  88.   database, you will be able to login on all machines on the net which
  89.   have the NIS client programs running.
  90.  
  91.   Sun is a trademark of Sun Microsystems, Inc. licensed to SunSoft, Inc.
  92.  
  93.   2.  Introduction
  94.  
  95.   More and more, Linux machines are installed as part of a network of
  96.   computers. To simplify network administration, most networks (mostly
  97.   Sun-based networks) run the Network Information Service. Linux
  98.   machines can take full advantage of existing NIS service or provide
  99.   NIS service themselves. Linux machines can also (with the NYS library)
  100.   act as limited NIS+ clients.
  101.  
  102.   This document tries to answer questions about setting up NIS(YP) on
  103.   your Linux machine. It does not talk about how to set up NIS+. Don't
  104.   forget to read section 5.1, The RPC Portmapper.
  105.  
  106.   2.1.  New versions of this document
  107.  
  108.   New versions of this document will be posted periodically (about every
  109.   month) to the newsgroups comp.os.linux.announce and
  110.   comp.os.linux.misc.  The document is archived on a number of Linux FTP
  111.   sites, including sunsite.unc.edu in /pub/Linux/docs/HOWTO.
  112.  
  113.   2.2.  Disclaimer
  114.  
  115.   Although this document has been put together to the best of our
  116.   knowledge it may, and probably does contain errors. Please read any
  117.   README files that are bundled with any of the various pieces of
  118.   software described in this document for more detailed and accurate
  119.   information. We will attempt to keep this document as error free as
  120.   possible.
  121.  
  122.   2.3.  Feedback
  123.  
  124.   If you have any comments, questions or suggestions please email them
  125.   to Erwin Embsen <erwin@nioz.nl>. Definitely contact him if you find
  126.   errors or obvious omissions.
  127.  
  128.   2.4.  Acknowledgements
  129.  
  130.   We would like to thank all the people who have contributed (directly
  131.   or indirectly) to this document. In alphabetical order:
  132.  
  133.        Andrea Dell'Amico <adellam@ZIA.ms.it>
  134.        Mitchum DSouza    <Mitch.DSouza@NetComm.IE>
  135.        Erwin Embsen      <erwin@nioz.nl>
  136.        Byron A Jeff      <byron@cc.gatech.edu>
  137.        Peter Eriksson    <peter@ifm.liu.se>
  138.  
  139.   Theo de Raadt <deraadt@theos.com> is responsible for the original yp-
  140.   clients code.  Swen Thuemmler <swen@uni-paderborn.de> ported the yp-
  141.   clients code to Linux and also ported the yp-routines in libc (again
  142.   based on Theo's work).
  143.  
  144.   3.  NIS or NIS+ ?
  145.  
  146.   The choice between NIS and NIS+ is easy - use NIS if you don't have to
  147.   use NIS+ or have severe security needs. NIS+ is _much_ more
  148.   problematic to administer (it's pretty easy to handle on the client
  149.   side, but the server side is horrible). Another problem is that the
  150.   support for NIS+ under Linux is still under developement - one major
  151.   thing it still lacks is support for data encryption/authentication
  152.   which is _the_ major thing why anyone would want to use NIS+...
  153.  
  154.   3.1.  Traditional NIS or the NYS library ?
  155.  
  156.   The choice between Traditional NIS or the NIS code in the NYS library
  157.   is a choice between laziness and maturity vs. flexibility and love of
  158.   adventure.
  159.  
  160.   The "traditional NIS" code is in the standard C library and has been
  161.   around longer and sometimes suffers from it's age and slight
  162.   inflexibility.
  163.  
  164.   The NIS code in the NYS library, on the other hand requires you either
  165.   to recompile and relink all your programs to the libnsl library, or
  166.   recompile the libc library to include the libnsl code into the libc
  167.   library (or maybe you can go get a precompiled version of libc from
  168.   someone who has already done it).
  169.  
  170.   Another difference is that the traditional NIS code has some support
  171.   for NIS Netgroups, which the NYS code doesn't (yet). On the other hand
  172.   the NYS code allows you to handle Shadow Passwords in a transparent
  173.   way.
  174.  
  175.   4.  How it works
  176.  
  177.   Within a network there must be at least one machine acting as a NIS
  178.   server. You can have multiple NIS servers, each serving different NIS
  179.   "domains" - or you can have cooperating NIS servers, where one is said
  180.   to be the master NIS server, and all the other are so-called slave NIS
  181.   servers (for a certain NIS "domain", that is!) - or you can have a mix
  182.   of them...
  183.  
  184.   Slave servers only have copies of the NIS databases and receive these
  185.   copies from the master NIS server whenever changes are made to the
  186.   master's databases.  Depending on the number of machines in your
  187.   network and the reliability of your network, you might decide to
  188.   install one or more slave servers.  Whenever a NIS server goes down or
  189.   is too slow in responding to requests, a NIS client connected to that
  190.   server will try to find one that is up or quicker.
  191.  
  192.   NIS databases are in so-called DBM format, derived from ASCII
  193.   databases.  For example, the files /etc/passwd and /etc/group can be
  194.   directly converted to DBM format using ASCII-to-DBM translation
  195.   software ("makedbm", it's included with the server software). The
  196.   master NIS server should have both, the ASCII databases and the DBM
  197.   databases.
  198.  
  199.   Slave servers  will be notified of any change to the NIS maps, (via
  200.   the "yppush" program), and automatically retrieve the necessary
  201.   changes in order to synchronize their databases. NIS clients do not
  202.   need to do this since they always talks to the NIS server to read the
  203.   information stored in it's DBM databases.
  204.  
  205.   The author of the YP clients for linux has informed us that the newest
  206.   ypbind (from yp-clients.tar.gz) is able to get the server from a
  207.   configuration file - thus no need to broadcast (which is insecure -
  208.   due to the fact that anyone may install a NIS server and answer the
  209.   broadcast queries...)
  210.  
  211.   5.  What do you need to set up NIS?
  212.  
  213.   5.1.  The RPC Portmapper
  214.  
  215.   To run any of the software mentioned below you will need to run the
  216.   program /usr/sbin/rpc.portmap. Some Linux distributions already have
  217.   the code in /etc/rc.d/rc.inet2 to start up this daemon.  All you have
  218.   to do is uncomment it and reboot your Linux machine to activate it.
  219.  
  220.   The RPC portmapper (portmap(8c)) is a server that converts RPC program
  221.   numbers into TCP/IP (or UDP/IP) protocol port numbers. It must be
  222.   running in order to make RPC calls (which is what the NIS client
  223.   software does) to RPC servers (like a NIS server) on that machine.
  224.   When an RPC server is started, it will tell portmap what port number
  225.   it is listening to, and what RPC program numbers it is prepared to
  226.   serve.  When a client wishes to make an RPC call to a given program
  227.   number, it will first contact portmap on the server machine to
  228.   determine the port number where RPC packets should be sent.
  229.  
  230.   Normally, standard RPC servers are started by inetd(8C), so portmap
  231.   must be started before inetd is invoked.
  232.  
  233.   5.2.  Determine whether you are a Server, Slave or Client.
  234.  
  235.   To answer this question you have to consider two cases:
  236.  
  237.   1. Your machine is going to be part of a network with existing NIS
  238.      servers
  239.  
  240.   2. You do not have any NIS servers in the network yet
  241.  
  242.   In the first case, you only need the client programs (ypbind, ypwhich,
  243.   ypcat, yppoll, ypmatch). The most important program is ypbind. This
  244.   program must be running at all times, that is, it should always appear
  245.   in the list of processes. It's a so-called daemon process and needs to
  246.   be started from the system's startup file (eg. /etc/rc.local).  As
  247.   soon as ypbind is running, your system has become a NIS client.
  248.  
  249.   In the second case, if you don't have NIS servers, then you will also
  250.   need a NIS server program (usually called ypserv). Section 6 describes
  251.   how to set up a NIS server on your Linux machine using the "ypserv"
  252.   implementation by Peter Eriksson (<peter@ifm.liu.se>).  Note that from
  253.   version 0.14 this implementation supports the master-slave concept
  254.   talked about in section 3.
  255.  
  256.   There is also another free NIS server available, called "yps", written
  257.   by Tobias Reber in Germany which does support the master-slave
  258.   concept, but has other limitations.
  259.  
  260.   5.3.  The Software
  261.  
  262.   The system library "/usr/lib/libc.a" (version 4.4.2 and better) or the
  263.   shared library "/usr/lib/libc.sa" and its related DLL contain all
  264.   necessary system calls to succesfully compile the NIS client and
  265.   server software.
  266.  
  267.   Some people reported that NIS only works with "/usr/lib/libc.a"
  268.   version 4.5.21 and better so if you want to play it safe don't use
  269.   older libc's.  The NIS client software can be obtained from:
  270.  
  271.     Site                  Directory                        File Name
  272.  
  273.     ftp.uni-paderborn.de  /linux/local/yp                  yp-clients-2.2.tar.gz
  274.     ftp.funet.fi          /pub/Linux/BETA/NYS/clients      yp-clients-?.?.tar.gz
  275.     ftp.lysator.liu.se    /pub/NYS/clients                 yp-clients-?.?.tar.gz
  276.     sunsite.unc.edu       /pub/Linux/system/Network/admin  yp-clients-2.2.tar.gz
  277.  
  278.   Once you obtained the software, please follow the instructions which
  279.   come with the software.
  280.  
  281.   5.4.  Setting up a NIS Client using Traditional NIS
  282.  
  283.   Assuming you have succesfully compiled the software you are now ready
  284.   to install the software. A suitable place for the ypbind daemon is the
  285.   directory /usr/sbin.
  286.  
  287.   You'll need to do this as root of course. The other binaries (ypwhich,
  288.   ypcat, yppoll, ypmatch) should go in a directory accessible by all
  289.   users, for example /usr/etc or /usr/local/bin.  It might be a good
  290.   idea to test ypbind before incorporating it in /etc/rc.d/rc.inet2.
  291.  
  292.   To test ypbind do the following:
  293.  
  294.   ╖  Make sure you have your domain name set. If it is not set then
  295.      issue the command:
  296.  
  297.                    /bin/domainname-yp nis.domain
  298.  
  299.   where nis.domain should be some string, _NOT_ normally associated with
  300.   the domain name of your machine! The reason for this is that it makes
  301.   it a little harder for external crackers to retreive the password
  302.   database from your NIS servers. If you don't know what the NIS domain
  303.   name is on your network, ask your system/network administrator.
  304.  
  305.   ╖  Start up "/usr/sbin/rpc.portmap" if it is not already running.
  306.  
  307.   ╖  Create the directory "/var/yp" if it does not exist.
  308.  
  309.   ╖  Start up "/usr/sbin/ypbind"
  310.  
  311.   ╖  Use the command "rpcinfo -p localhost" to check if ypbind was able
  312.      to register its service with the portmapper. The rpcinfo should
  313.      produce something like:
  314.  
  315.          program vers proto   port
  316.           100000    2   tcp    111  portmapper
  317.           100000    2   udp    111  portmapper
  318.           100007    2   udp    637  ypbind
  319.           100007    2   tcp    639  ypbind
  320.           300019    1   udp    660
  321.  
  322.   ╖  You may also run "rpcinfo -u localhost ypbind". This command should
  323.      produce something like:
  324.  
  325.                program 100007 version 2 ready and waiting
  326.  
  327.   Finally, do not forget that for host lookups you must set (or add)
  328.   "nis" to the lookup order line in your /etc/host.conf file. Please
  329.   read the manpage "resolv+.8" for more details.
  330.  
  331.   At this point you should be able to use NIS client programs like
  332.   ypcat, etc...  For example, "ypcat passwd" will give you the entire
  333.   NIS password database.
  334.  
  335.   IMPORTANT: If you skipped the test procedure then make sure you have
  336.   set the domain name, and created the directory:
  337.  
  338.            /var/yp
  339.  
  340.   This directory MUST exist for ypbind to start up succesfully.
  341.  
  342.   If the test worked you may now want to change the files /etc/rc.d/rc.M
  343.   and /etc/rc.d/rc.inet2 on your system so that ypbind will be started
  344.   up at boot time and your system will act as a NIS client. Edit the
  345.   file /etc/rc.d/rc.M and look for the commands which set the domain
  346.   name.  Change the domain name into the name of your domain. Also, edit
  347.   the file /etc/rc.d/rc.inet2, comment out the lines which start up the
  348.   rpc.portmap daemon, and add the following lines just after the place
  349.   where rpc.portmap is started:
  350.  
  351.            #
  352.            # Start the ypbind daemon
  353.            #
  354.            if [ -f ${NET}/ypbind -a -d /var/yp ]; then
  355.                echo -n " ypbind"
  356.                ${NET}/ypbind
  357.            fi
  358.  
  359.   Unlike Sun's implementation of NIS you do not need to edit /etc/passwd
  360.   and /etc/group to take advantage of NIS. Sun's implementation needs a
  361.   line "+:*:0:0:::" in /etc/passwd and a line "+:*:0:" in /etc/group to
  362.   tell NIS to search the NIS password and group databases.
  363.  
  364.   IMPORTANT: Note that the command finger will report "no such user"
  365.   messages if you do not add the line "+:*:0:0:::" to /etc/passwd.
  366.   Putting the line "+:*:0:0:::" back in /etc/passwd fixes finger.
  367.  
  368.   Well, that's it. Reboot the machine and watch the boot messages to see
  369.   if ypbind is actually started.
  370.  
  371.   IMPORTANT: Note that the netgroup  feature is implemented starting
  372.   from libc 4.5.26. Netgroups allow access control for every machine and
  373.   every user in the NIS domain, and they require an entry like:
  374.  
  375.            +@this_machine_users
  376.  
  377.   in /etc/passwd. But if you have a version of libc earlier than 4.5.26,
  378.   every  user  in  the  NIS password database can access your linux
  379.   machine if you run "ypbind".
  380.  
  381.   6.  What you need to set up NYS?
  382.  
  383.   6.1.  Determine whether you are a Server, Slave or Client.
  384.  
  385.   To answer this question you have to consider two cases:
  386.  
  387.   ╖  Your machine is going to be part of a network with existing NIS
  388.      servers
  389.  
  390.   ╖  You do not have any NIS servers in the network yet
  391.  
  392.   In the first case you have two choices:
  393.  
  394.   ╖  Either you relink all client and daemon programs with the NYS
  395.      library libnsl.so (or statically link them with libnsl.a). This
  396.      means adding the line:
  397.  
  398.                    LIBS=-lnsl
  399.  
  400.   to your Makefile signifing you want to link the Network Services
  401.   Library. Basically all network deamons and the "login" program need to
  402.   be recompiled.
  403.  
  404.   ╖  Or you can recompile the standard C library libc to include the NYS
  405.      client library functions into the normal libc library, and then
  406.      relink all statically linked programs (the dynamically linked
  407.      programs automatically get the new version of libc).  See section
  408.      6.5 below for more information about this option.
  409.   Similarly like in the case of traditional NIS, if you don't have NIS
  410.   servers, then you will also need a NIS server program (usually called
  411.   ypserv) and you have to designate one of the machines in your network
  412.   as a master NIS server. Again, you might want to set up at least one
  413.   slave server as well.
  414.  
  415.   6.2.  The Software
  416.  
  417.   You need to retrieve and compile the NYS services library libnsl.so.
  418.   If you don't have the DLL tools installed you may retrieve a
  419.   precompiled shared, static and stub library from the same site
  420.   mentioned below. Note, however, that the precompiled version may be
  421.   (and probably is) older than the latest source code release.
  422.  
  423.   The NYS library (source and precompiled version) can be obtained from:
  424.  
  425.          Site                Directory                    File Name
  426.  
  427.          ftp.lysator.liu.se  /pub/NYS/libs                nys-0.27.4.tar.gz
  428.          ftp.lysator.liu.se  /pub/NYS/binaries/lib        libnsl.so.1.0.a26
  429.  
  430.          ftp.funet.fi        /pub/Linux/BETA/NYS/libs     nys-0.27.?.tar.gz
  431.  
  432.   Precompiled "login" and "su" programs may also be fetched from
  433.  
  434.          Site                Directory                    File Name
  435.  
  436.          ftp.lysator.liu.se  /pub/NYS/binaries/bin        login
  437.          ftp.lysator.liu.se  /pub/NYS/binaries/bin        su
  438.  
  439.          ftp.funet.fi        /pub/Linux/BETA/NYS/bin      login
  440.          ftp.funet.fi        /pub/Linux/BETA/NYS/bin      su
  441.  
  442.   Similarly, example configuration files may be retrieved from
  443.  
  444.          Site                Directory                   File Name
  445.  
  446.          ftp.lysator.liu.se  /pub/NYS/binaries/etc       *conf
  447.          ftp.funet.fi        /pub/Linux/BETA/NYS/etc     *conf
  448.  
  449.   For compilation of the nsl library, please follow the instructions
  450.   which come with the software. If you wish to compile the shared DLL
  451.   library you must have the DLL tools installed in the standard place
  452.   (/usr/dll). The DLL tools (the package tools-2.11.tar.gz or later) can
  453.   be obtained from many sites.
  454.  
  455.   6.3.  Setting up a NYS Client using NYS
  456.  
  457.   Unlike traditional NIS, there is no setting up required for a NIS
  458.   client. All that is required is that the NIS configuration file
  459.   (/etc/yp.conf) points to the correct server(s) for its information.
  460.   Also, the Name Services Switch configuration file (/etc/nsswitch.conf)
  461.   must be correctly set up.
  462.  
  463.   Please refer to the examples provided with the source code.
  464.  
  465.   6.4.  The nsswitch.conf File
  466.  
  467.   The Network Services switch file /etc/nsswitch.conf determines the
  468.   order of lookups performed when a certain piece of information is
  469.   requested, just like the /etc/host.conf file which determines the way
  470.   host lookups are performed. Again, look at at the example file
  471.   provided in the source distribution. For example, the line
  472.  
  473.            hosts: files nis dns
  474.  
  475.   specifies that host lookup functions should first look in the local
  476.   /etc/hosts file, followed by a NIS lookup and finally thru the domain
  477.   name service (/etc/resolv.conf and named), at which point if no match
  478.   is found an error is returned.
  479.  
  480.   6.5.  Making your binaries NYS aware
  481.  
  482.   Instead of relinking each binary with the NYS library (libnsl.so), a
  483.   cleaner solution has been achieved by providing the user with the
  484.   ability to build a NYS aware libc. This means all you need to do is
  485.   recompile a new libc and replace your existing /lib/libc.so.x.y.z for
  486.   all (non-static compiled) programs to be NYS aware.
  487.  
  488.   This merge also gives you the advantage over the traditional NIS
  489.   implementation in the linux libc in that it allows transparent shadow
  490.   passwords support (via the /etc/nisswitch.conf file).
  491.  
  492.   Follow the simple steps below to rebuild a NYS aware libc.
  493.  
  494.   ╖  Make sure you have the latest DLL tools installed. Refer to the the
  495.      GCC-FAQ for more info on where to get this.
  496.  
  497.   ╖  Get the latest libc sources. (again see GCC-FAQ)
  498.  
  499.   ╖  Get the latest nys sources from
  500.  
  501.                  ftp.lysator.liu.se:/pub/NYS/libs
  502.  
  503.   and extract it under this libc-linux source directory.  The current
  504.   NYS distribution is "nys-0.27.4.tar.gz".
  505.  
  506.   ╖  Do the ./configure as before and first answer "n" to the question
  507.  
  508.                  Values correct (y/n) [y] ?
  509.  
  510.   Then go thru all the other questions and the last question will now be
  511.  
  512.                  Build a NYS libc from nys-0.27 (y default) ?
  513.  
  514.   answer "y" to this.
  515.  
  516.   ╖  Then issue the command
  517.  
  518.                  % make
  519.  
  520.   The library generated after compilation is named something like
  521.  
  522.            libc.so.4.5.26
  523.  
  524.   and placed under the directory jump/libc-nys. To install this library
  525.   our advise would be copying it to /lib with a name lexiographically
  526.   greater than the version number it currently has. Just appending the
  527.   letter "a" should do the trick.  For example:
  528.  
  529.            % cp jump/libc-nys/libc.so.4.5.26 /lib/libc.so.4.5.26a
  530.  
  531.   Alternatively, append "nys" to it so you can quickly identify it.  Now
  532.   run the command
  533.  
  534.            % ldconfig
  535.  
  536.   which will reset your cache to use the new library. The dynamic linker
  537.   strategy may be examined with the command "ldconfig -p".
  538.  
  539.   That's basically it. All your programs should now be NYS aware. Please
  540.   note that usually the program "login" is compiled static and thus
  541.   cannot access the new NYS functions from the NYS aware libc. You must
  542.   either recompile "login" without the -static flag, or else statically
  543.   link it to the libnsl.a library.
  544.  
  545.   7.  Setting up a NIS Server
  546.  
  547.   7.1.  The Server Program ypserv
  548.  
  549.   This document only describes how to set up the "ypserv" NIS server.
  550.   The "yps" server setup is similar, _but_ not exactly the same so
  551.   beware if you try to apply these instructions to "yps"!
  552.  
  553.   The NIS server software can be found on:
  554.  
  555.          Site                   Directory                             File Name
  556.  
  557.          ftp.lysator.liu.se    /pub/NYS/servers                       ypserv-1.1.2.tar.gz
  558.          ftp.uni-paderborn.de  /pub/linux/local/yp                    ypserv-1.1.2.tar.gz
  559.          ftp.funet.fi          /pub/Linux/BETA/NYS/servers            ypserv-?.?.?.tar.gz
  560.  
  561.   The server setup is the same for both traditional NIS and NYS.
  562.  
  563.   Compile the software to generate the "ypserv" and "makedbm" programs.
  564.   Firstly, determine what files you require to be available via NIS and
  565.   then add or remove the appropriate entries to the ypMakefile. Install
  566.   the file ypMakefile into /var/yp as the file Makefile.
  567.  
  568.   Now build the DBM files by typing:
  569.  
  570.            % cd /var/yp; make
  571.  
  572.   Make sure the portmapper (rpc.portmap) is running, and start the
  573.   server "ypserv". The command
  574.  
  575.            % rpcinfo -u localhost ypserv
  576.  
  577.   should output something like
  578.  
  579.            program 100004 version 2 ready and waiting
  580.  
  581.   That's it, your server is up and running.
  582.  
  583.   7.2.  The Server Program yps
  584.  
  585.   To set up the "yps" NIS server please refer to the previous paragraph.
  586.   The "yps" server setup is similar, _but_ not exactly the same so
  587.   beware if you try to apply the "ypserv" instructions to "yps"!
  588.  
  589.   The "yps" NIS server software can be found on:
  590.  
  591.          Site                Directory                              File Name
  592.  
  593.          ftp.lysator.liu.se  /pub/NYS/servers                       yps-0.21.tar.gz
  594.          ftp.funet.fi        /pub/Linux/BETA/NYS/servers            yps-0.21.tar.gz
  595.  
  596.   7.3.  The Program yppasswdd
  597.  
  598.   Whenever users change their passwords, the NIS password database and
  599.   probably other NIS databases, which depend on the NIS password
  600.   database, should be updated.  The program "yppasswdd" is a server that
  601.   handles password changes and makes sure that the NIS information will
  602.   be updated accordingly. The software for "yppasswdd" can be found on:
  603.  
  604.          Site                Directory                              File Name
  605.  
  606.          ftp.lysator.liu.se  /pub/NYS                               yppasswdd-0.7.tar.gz
  607.          ftp.funet.fi        /pub/Linux/BETA/NYS/servers            yppasswdd-0.7.tar.gz
  608.  
  609.   Once you obtained the software, please follow the instructions which
  610.   come with the software.
  611.  
  612.   8.  Verifying the NIS/NYS Installation
  613.  
  614.   If everything is fine (as it should be), you should be able to verify
  615.   your installation with a few simple commands. Assuming, for example,
  616.   your passwd file is being supplied by NIS, the command
  617.  
  618.            % ypcat passwd
  619.  
  620.   should give you the contents of your NIS passwd file. The command
  621.  
  622.            % ypmatch userid passwd
  623.  
  624.   (where userid is the login name of an arbitrary user) should give you
  625.   the user's entry in the NIS passwd file. The "ypcat" and "ypmatch"
  626.   programs should be included with your distribution of traditional NIS
  627.   or NYS.
  628.  
  629.   9.  Common Problems and Troubleshooting NIS
  630.  
  631.   Here are some common problems reported by various users:
  632.  
  633.   1. The libraries for 4.5.19 are broken. NIS won't work with it.
  634.  
  635.   2. If you upgrade the libraries from 4.5.19 to 4.5.24 then the su
  636.      command breaks. You need to get the su command from the slackware
  637.      1.2.0 distribution. Incidentally that's where you can get the
  638.      updated libraries.
  639.  
  640.   3. You could run into trouble with NIS and DNS on the same machine.
  641.      My DNS server occasionally will not bring up NIS. Haven't yet
  642.      tracked down why.
  643.  
  644.   4. When a NIS server goes down and comes up again ypbind starts
  645.      complaining with messages like:
  646.  
  647.               yp_match: clnt_call:
  648.                           RPC: Unable to receive; errno = Connection refused
  649.  
  650.   and logins are refused for those who are registered in the NIS
  651.   database. Try to login as root and if you succeed, then kill ypbind
  652.   and start it up again.
  653.  
  654.   10.  Frequently Asked Questions
  655.  
  656.   Most of your questions should be answered by now. If there are still
  657.   questions unanswered you might want to post a message to
  658.  
  659.            comp.os.linux.help
  660.  
  661.   or
  662.  
  663.            comp.os.linux.networking
  664.  
  665.   or contact one of the authors of this HOWTO.
  666.  
  667.