Configuring the NIS Master Server

Attention: An NIS record has a maximum size of 1024 bytes. This limitation applies to all NIS map files. For example, a list of users in a group can contain a maximum of 1024 characters in single-byte character set file format. Before doing the following procedure, ensure that no configuration file is beyond this limit. NIS cannot operate correctly with map files that exceed this maximum.

To configure an NIS master server, do the following tasks on the master server host:

  1. Follow the instructions in Preparing a Host for NIS Configuration.
  2. Set the domain name by following the instructions in Setting the NIS Domain Name.
  3. Decide what information you want to manage using NIS. By default, you manage all the information contained in the files listed in NIS Maps. You may want to customize how you manage users, groups, and host names, especially if you have already configured a domain name server. To do so, follow the instructions in Customizing NIS Map Input.

You will now create the directory for this domain, build the NIS maps, and start the NIS daemons. Use the Web-based System Manager or use one of the following procedures.

  • Using SMIT, enter: smit mkmaster.
    • Specify in the HOSTS that will be slave servers field the names of the hosts, if any, that you want to act as worker servers.
    • Specify yes in the fields Can existing MAPS for the domain be overwritten? and EXIT on errors, when creating master server? because you will want to know if an error occurs.
    • If you want to configure your NIS domain for secure Remote Procedure Call (RPC) networking, specify yes in the START the yppasswdd daemon? and START the ypupdated daemon? fields. You should also configure secure NFS by following the instructions in Networks and communication management.
    • Specify yes in the START the ypbind daemon? field to configure the master server to use the NIS databases.
    • Specify both in the START the master server... field.
    • Accept your changes and exit SMIT.

      The system takes a few minutes to perform several tasks. First, it runs the ypinit command. If the ypinit command exits successfully, the system uncomments the entries in the /etc/rc.nfs file for the daemons to which you specified yes above. Finally, the system starts these daemons.

      The ypinit command is a shell script that performs two tasks. First, it creates the directory /var/yp/domainname, where domainname is the domain name you defined above. Second, it runs the make command on the /var/yp/Makefile, which creates all the NIS maps specified in the /var/yp/Makefile.

  • Using the command line:
    1. Enter the ypinit -m command. This command prompts you for various information, including the names of any worker servers, and takes a few minutes to complete.
    2. Start the ypserv and ypbind daemons (and the yppasswdd and ypupdated daemons if you want) by following the instructions in Starting and Stopping NIS Daemons.
    3. Edit the /etc/rc.nfs file and uncomment the lines that use the startsrc commands to start these daemons (delete the pound signs at the beginning of each line). For example, if the original lines look like the following:
      #if [ -x /usr/etc/ypserv -a -d /etc/yp/`domainname` ]; then
      #       startsrc -s ypserv
      #fi
      Remove the pound signs so the file looks like:
      if [ -x /usr/etc/ypserv -a -d /etc/yp/`domainname` ]; then
             startsrc -s ypserv
      fi