System Administration Guide: Naming and Directory Services (NIS+)

Chapter 4 Configuring NIS+ With Scripts

This chapter describes how to configure a basic NIS+ namespace using the nisserver, nispopulate, and nisclient scripts in combination with a few NIS+ commands.


Note –

NIS+ might not be supported in a future release. Tools to aid the migration from NIS+ to LDAP are available as of the Solaris 9 release. For more information, see System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) and visit NIS+ End-of-Feature (EOF) Announcement FAQ.


NIS+ Configuration Overview

Using the configuration scripts is the recommended method of setting up and configuring an NIS+ namespace. Using these scripts is easier than to trying to set up an NIS+ namespace with the NIS+ command set, as described in Chapter 6, Configuring NIS+ Clients, Chapter 7, Configuring NIS+ Servers, and Chapter 8, Configuring an NIS+ Non-Root Domain.

(See the nisserver, nispopulate, and nisclient man pages for complete descriptions of the scripts. See the Glossary for definitions of terms and acronyms you do not recognize.)

You should not use the small sample NIS+ namespace referred to in this tutorial manual as a basis for your actual NIS+ namespace. You should destroy the sample namespace after you finish exploring it, instead of adding on to it. It is better to begin again and carefully plan your NIS+ hierarchy before you create your actual namespace.

Table 4–1 summarizes the recommended generic configuration procedure. The left column lists the major configuration activities, such as configuring the root domain or creating a client. The text in the middle describes the activities. The third column lists which script or commands accomplish each step.

Table 4–1 Recommended NIS+ Configuration Procedure Overview

Activity 

Description 

Script/ Commands 

Plan your new NIS+ namespace 

Plan your new NIS+ namespace. See Chapter 2, NIS+: An Introduction for a full discussion of planning requirements and steps. (If you are just following the NIS+ tutorial in a test-bed network, this step has been done for you.)

 

Prepare your existing namespace 

In order for the scripts to work best, your current namespace (if any) must be properly prepared. See Preparing the Existing Namespace for NIS+ for a description of necessary preparations. (If you are just following the NIS+ tutorial in a test-bed network, this step has been done for you.)

 

Configure the Diffie-Hellman key length 

If you intend to use DES authentication, consider using Diffie-Hellman keys longer than the 192-bit default. The extended key length must be the same on all machines in the domain. Specify the desired key length before running the respective initialization scripts. 

nisauthconf

Configure root Domain 

Create the root domain. Configure and initialize the root master server. Create the root domain admin group. 

nisserver

Populate tables 

Populate the NIS+ tables of the root domain from text files or NIS maps. Create credentials for root domain clients. Create administrator credentials. 

nispopulate

nisgrpadm

nisping

Configure root domain clients 

Configure the client machines. (Some of them will subsequently be converted into servers.) Initialize users as NIS+ clients. 

nisclient

Enable servers 

Enable some clients of the root domain to become servers. Some servers will later become root replicas; others will support lower-level domains. 

svcadm enable

Configure root replicas 

Designate one or more of the servers you just configured as replicas of the root domain. 

nisserver

svcadm

Configure non-root domains 

Create a new domain. Designate a previously enabled server as its master. Create its admin group and admin credentials. 

nisserver

Populate tables 

Create credentials for clients of the new domain. Populate the NIS+ tables of the new domain from text files or NIS maps. 

nispopulate

Configure non-root domain clients 

Configure the clients of the new domain. (Some may subsequently be converted into servers for lower-level domains.) Initialize users as NIS+ clients. 

nisclient

The NIS+ scripts enable to you to skip most of the individual procedures included in the above activities.

NIS+ and the Service Management Facility

Most of the command line administrative tasks associated with the NIS+ service are managed by the Service Management Facility (SMF). For an overview of SMF, refer to Chapter 18, Managing Services (Overview), in System Administration Guide: Basic Administration. Also refer to the svcadm(1M) and svcs(1) man pages for more details.

Using svcadm With rpc.nisd -x

In general, the /usr/sbin/rpc.nisd daemon is administered using the svcadm command. However, when rpc.nisd is invoked with -x nisplusLDAPinitialUpdateOnly=yes, rpc.nisd performs the specified action, then exits. That is, rpc.nisd does not daemonize. SMF should not be used in conjunction with -x nisplusLDAPinitialUpdateOnly=yes. SMF can be used any other time you want to start, stop, or restart the rpc.nisd daemon.

The following example shows rpc.nisd used with -x nisplusLDAPinitialUpdateOnly=yes.


# /usr/sbin/rpc.nisd -m mappingfile \
-x nisplusLDAPinitialUpdateAction=from_ldap \
-x nisplusLDAPinitialUpdateOnly=yes

Modifying the /lib/svc/method/nisplus File

If you want to include specific options when you invoke the rpc.nisd daemon with SMF, add the options to the /lib/svc/method/nisplus file. The following list provides some commonly used options.

-S 0

Sets the server's security level to 0, which is required at this point for bootstrapping.

Because no cred table exists yet, no NIS+ principals can have credentials. If you use a higher security level, you are locked out of the server.

-B

Supports DNS forwarding

-Y

Starts the NIS+ daemon in NIS-compatibility mode

ProcedureHow to Modify the /lib/svc/method/nisplus File

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.

  2. Stop the NIS+ service.


    # svcadm disable network/rpc/nisplus:default
    
  3. Open the /lib/svc/method/nisplus file.

    Use your preferred text editor.

  4. Edit the file to add the desired options.

    Example –

    Change:


    /usr/sbin/rpc.nisd $nisd_flags || exit $?

    To:


    /usr/sbin/rpc.nisd $nisd_flags -Y -B || exit $?

    In this example, the -Y and -B options are added to rpc.nisd, so the options are automatically implemented at startup.

  5. Save and quit.

  6. Start the NIS+ service.


    # svcadm enable network/rpc/nisplus:default
    

Creating a Sample NIS+ Namespace

The procedures in this chapter show you how to create a sample NIS+ namespace. The sample NIS+ namespace will be created from /etc files and NIS maps. This sample shows you how to use the scripts both when your site is not running NIS and when NIS is running at your site. You can set your servers to NIS-compatibility mode if they will be serving NIS clients. See Solaris 1 Release and NIS-Compatibility Mode for more information on NIS-compatibility mode.


Note –

Your site's actual NIS+ namespace and its domain hierarchy probably differs from the sample namespace's, and yours probably contains a different number of servers, clients, and domains. Do not expect any resemblance between your final domain configuration or hierarchy and the sample one. The sample namespace is only an illustration of how to use the NIS+ scripts. After you have created this sample namespace, you should have a clear idea about how to create domains, servers, and clients at your site.


The sample namespace contains the following components:

This scenario shows the scripts being used to configure NIS+ at a site that uses both system information files, such as /etc/hosts, and NIS maps to store network service information. The sample NIS+ namespace uses such a mixed site purely for example purposes.

Summary of NIS+ Scripts Command Lines

Table 4–2 contains the generic sequence of NIS+ scripts and commands you will use to create a ample NIS+ domain. Subsequent sections describe these command lines in detail. After you are familiar with the tasks required to create NIS+ domains, servers, and clients, use Table 4–2 as a quick-reference guide to the appropriate command lines. Table 4–2 is a summary of the actual commands with the appropriate variables that you type to create the sample NIS+ namespace.

Table 4–2 NIS+ Domains Configuration Command Lines Summary

Action 

Machine 

Command 

Include /usr/lib/nis in root's path; C shell or Bourne shell.

Root master server and client machines as superuser 

setenv PATH $PATH:/usr/lib/nis

or 

PATH=$PATH:/usr/lib/nis; export PATH

Optionally, if using DES authentication, select the Diffie-Hellman key length 

Server and client machines as superuser 

nisauthconf -dhkey-length-alg-type des

Create a root master server without or with NIS (YP) compatibility. 

Root master server as superuser 

nisserver -r-dnewdomain.

or 

nisserver -Y-r-d newdomain.

Populate the root master server tables from files or from NIS maps. 

Root master server as superuser 

nispopulate -F-p /files -d newdomain.

or 

nispopulate -Y-d newdomain. -h NISservername\ -a NIS_server_ipaddress -y NIS_domain

Add additional users to the NIS+ admin group. 

Root master server as superuser 

nisgrpadm-aadmin.domain.name.domain.

Make a checkpoint of the NIS+ database. 

Root master server as superuser 

nisping -C domain.

Initialize a new client machine. 

Client machine as superuser 

nisclient -i-d domain. -h master1

Initialize user as an NIS+ client. 

Client machine as user 

nisclient -u

Start the NIS+ service (rpc.nisd daemon) – required to convert a client to a server without or with NIS compatibility (and DNS forwarding).

Client machine as superuser 

Modify the /lib/svc/method/nisplus file to add the -Y or -B options as needed, then enable the NIS+ service:

svcadm enable /network/rpc/nisplus

Convert a server to a root replica. 

Root master server as superuser 

nisserver-R-d domain. -h clientname

Convert a server to a non-root master server. 

Root master server as superuser 

nisserver -M-d newsubdomain.domain. -h\clientmachine

Populate the new master server tables from files or from NIS maps. 

New subdomain master server as superuser 

nispopulate -F-p/subdomaindirectory -d \ newsubdomain.domain.

or 

nispopulate-Y-dnewsubdomain.domain.-h NISservername -aNIS_server_ipaddress -y NIS_domain

Convert a client to a master server replica. 

Subdomain master server as superuser 

nisserver-R-dsubdomain.domain. -h clientname

Initialize a new client of the subdomain. Clients can be converted to subdomain replicas or to another server. 

New subdomain client machine as superuser 

nisclient -i -d newsubdomain.domain. -h \ subdomainmaster

Initialize user as an NIS+ client. 

Client machine as user 

nisclient -u


Note –

To see what commands an NIS+ script calls, without actually executing the commands, use the -x option. The -x option causes the command names and their approximate output to echo to the screen as if you were actually running the script. Running the scripts for the first time with -x can minimize unexpected results. For more information, see the man pages for the scripts.


Setting Up NIS+ Root Servers

Setting up the root master server is the first activity towards establishing NIS+ domain. This section shows you how to configure a root master server using the nisserver script with default settings.

The root master server uses the following defaults:


Note –

The nisserver script modifies the name service switch file for NIS+ when it sets up a root master server. The /etc/nsswitch.conf file can be changed later. See Chapter 1, Name Service Switch for information on the name service switch.


Prerequisites to Running nisserver to Set Up a Root Server

Check to see that the /etc/passwd file on the machine you want to be root master server contains an entry for root.

You need the following information before running nisserver.

Table 4–3 Internet Organizational Domains

Domain 

Purpose 

com 

Commercial organizations 

edu 

Educational institutions 

gov 

Government institutions 

mil 

Military groups 

net 

Major network support centers 

org 

Nonprofit organizations and others 

int 

International organizations 

In the following example, the machine that is designated as the root master server is called master1, and doc.com. becomes the new root domain.


Note –

Domains and hosts should not have the same name. For example, if you have doc.com. as a root domain, you should not have a machine named doc in any of your domains. Similarly, if you have a machine named home, you do not want to create a domain named home. This caution also applies to subdomains. For example, if you have a machine named west, you do not want to create a sales.west.doc.com subdomain.


ProcedureHow to Create an NIS+ Root Master Server

  1. Set the superuser's PATH variable to include /usr/lib/nis.

    Either add this path to root's .cshrc or .profile file or set the variable directly.

  2. Optionally, if using DES authentication, specify the Diffie-Hellman key length.

    To use 640–bit Diffie-Hellman keys as well as the default 192–bit keys, type:


    nisauthconf dh640-0 des

    To allow only 640–bit keys (rejects 192–bit keys), type:


    nisauthconf dh640-0
  3. Type the following command as superuser (root) to configure a root master server.

    The -r option indicates that a root master server should be configure. The -d option specifies the NIS+ domain name.


    master1# nisserver -r -d doc.com.
    This script sets up this machine “master1” as an NIS+ root master
    server for domain doc.com.
    Domain name : doc.com.
    NIS+ group : admin.doc.com.
    NIS (YP) compatibility : OFF
    Security level : 2=DES
    Is this information correct? (type 'y' to accept, 'n' to change)

    “NIS+ group” refers to the group of users who are authorized to modify the information in the doc.com. domain. (Domain names always end with a period.) Modification includes deletion. admin.domainname is the default name of the group. See How to Change Incorrect Information When Setting Up NIS+ for instructions on how to change this name.

    “NIS compatibility” refers to whether an NIS+ server accepts information requests from NIS clients. When set to OFF, the default setting, the NIS+ server does not fulfill requests from NIS clients. When set to ON, an NIS+ server fulfills such requests. You can change the NIS-compatibility setting with this script. See How to Change Incorrect Information When Setting Up NIS+.


    Note –

    This script sets machines up only at security level 2, the highest level of NIS+ security. You cannot change the security level when using this script. After the script has completed, you can change the security level with the appropriate NIS+ command. See the rpc.nisd man page for more information on changing security levels.


  4. Type y (if the information shown on the screen is correct).

    Typing n causes the script to prompt you for the correct information. (See How to Change Incorrect Information When Setting Up NIS+ for what you need to do if you type n.)


    Is this information correct? (type 'y' to accept, 'n'' to change) 
    y
    This script will set up your machine as a root master server for 
    domain doc.com. without NIS compatibility at security level 2.
    Use "nisclient -r" to restore your current network service environment.
    Do you want to continue? (type `y' to continue, `n' to exit the script)
  5. Type y to continue NIS+ configuration.

    (Typing n safely stops the script.) If you interrupt the script after you have chosen y and while the script is running, the script stops running and leaves configured whatever it has created so far. The script does not do any automatic recovery or cleaning up. You can always rerun this script.


    Do you want to continue? (type 'y' to continue, 'n' to exit the script
    y
    setting up domain information “doc.com.” ...
    setting up switch information ...
    running nisinit ...
    This machine is in the doc.com. NIS+ domain.
    Setting up root server ...
    All done.
    starting root server at security level 0 to create credentials...
    running nissetup ...
    (creating standard directories & tables)
    org_dir.doc.com. created
    Enter login password:

    The nissetup command creates the directories for each NIS+ table.

  6. Type your machine's root password at the prompt and press Return.

    In this case, the user typed the master1 machine's root password.


    Wrote secret key into /etc/.rootkey
    setting NIS+ group to admin.doc.com. ...
    restarting root server at security level 2 ...
    This system is now configured as a root server for domain doc.com.
    You can now populate the standard NIS+ tables by using the
    nispopulate or /usr/lib/nis/nisaddent commands.

    Your root master server is now configured and ready for you to populate the NIS+ standard tables. To continue with populating tables, skip to Populating NIS+ Tables.

ProcedureHow to Change Incorrect Information When Setting Up NIS+

If you typed n because some or all of the information returned to you was wrong in Step 4 in the above procedure, you will see the following:


Is this information correct? (type 'y' to accept, 'n' to change)
 n
Domain name: [doc.com.]
  1. Press Return if the domain name is correct; otherwise, type the correct domain name and press Return.

    In this example, Return was pressed, confirming that doc.com. is the desired domain name. The script then prompts for the NIS+ group name.


    Is this information correct? (type 'y' to accept, 'n' to change)
     n
    Domain name: [doc.com.]
    NIS+ group: [admin.doc.com.]
  2. Press Return if NIS+ group is correct; otherwise, type the correct NIS+ group name and press Return.

    In this example, the name was changed. The script then prompts for NIS compatibility.


    NIS+ group: [admin.doc.com.] netadmin.doc.com.
    NIS (YP) compatibility (0=off, 1=on): [0]
  3. Press Return if you do not want NIS compatibility; otherwise, type 1 and press Return.

    In this example, Return was pressed, confirming that NIS compatibility status is correct. Once again, the script asks you if the information is correct.


    Note –

    If you choose to make this server NIS compatible, you also need to edit a file and restart the rpc.nisd daemon before it will work. See Configuring a Client as an NIS+ Server for more information.



    NIS (YP) compatibility (0=off, 1=on): [0]
    Domain name : doc.com.
    NIS+ group : netadmin.doc.com.
    NIS (YP) compatibility : OFF
    Security level : 2=DES
    Is this information correct? (type 'y' to accept, 'n' to change) 

    When the information is correct, continue with Step 3 in How to Create an NIS+ Root Master Server. You can keep choosing -n until the information is correct.

ProcedureHow to Set Up a Multihomed NIS+ Root Master Server

The procedure for setting up a multihomed NIS+ server is the same as setting up a single interface server. The only difference is that there are more interfaces that need to be defined in the hosts database, the /etc/hosts file and NIS+ hosts table.


Note –

Prior to the Solaris 10 7/07 release, you also need to define interfaces in the /etc/inet/ipnodes file and ipnodes table.


Once the host information is defined, use the nisclient and nisserver scripts to set up the multihomed NIS+ server. For information about setting up a multihomed replica server, see How to Set Up Multihomed NIS+ Replica Servers.


Caution – Caution –

When setting up a multihomed NIS+ server, the server's primary name must be the same as the nodename for the system. This is a requirement of both Secured RPC and nisclient.

If these names are different, Secure RPC authentication will fail to work properly causing NIS+ problems.


The following procedure shows how to set up an NIS+ root master server:

  1. On the root master, add the server host information into the /etc/hosts file.


    Note –

    Prior to the Solaris 10 7/07 release, you must also add IPv6 host information to the /etc/inet/ipnodes file.


    For example, the /etc/hosts file for the hostA system with three Ethernet interfaces looks like:


    127.0.0.1 localhost loghost
    192.168.10.x hostA hostA-10 hostA-eri0
    192.168.11.y hostA hostA-11 hostA-eri1
    192.168.12.z hostA hostA-12
     
  2. Set up the server as a multihome NIS+ root server with nisserver.


    hostA# nisserver -r -d sun.com

    where our example shows sun.com as the root domain name. Issue the nisserver command using the name of your root domain name.

    After completing the steps for setting up a multihome NIS+ root server, the remainder of the setup is exactly the same as for a single interface server.

Populating NIS+ Tables

After the root master server has been configured, you can populate its standard NIS+ tables with name services information. This section shows you how to populate the root master server's tables with data from files or NIS maps using the nispopulate script with default settings.

The script uses:


Note –

The shadow file's contents are merged with the passwd file's to create the passwd table when files are the tables' information source. No shadow table is created.


Prerequisites to Running nispopulate to Populate Root Server Tables

Before you run the nispopulate script, be sure the following prerequisites have been met.

ProcedureHow to Populate the NIS+ Root Master Server Tables

Before You Begin

Note –

The NIS domain name is case-sensitive, while the NIS+ domain name is not.


If populating from files, you need the following information.

If populating from NIS maps, you need:

  1. Perform either substep a or b to populate the root master server tables, then continue with Step 2.

    Substep a shows you how to populate tables from files. Substep b shows you how to populate tables from NIS maps. Type these commands in a scrolling window; otherwise, the script's output might scroll off the screen.


    Note –

    The nispopulate script can fail if there is insufficient /tmp space on the system. To keep this from happening, you can set the environment variable TMPDIR to a different directory. If TMPDIR is not set to a valid directory, the script uses the /tmp directory.


    1. Type the following command to populate the tables from files.


      master1# nispopulate -F -p /nis+files -d doc.com.
      NIS+ domain name : doc.com.
      Directory Path : /nis+files
      Is this information correct? (type 'y' to accept, 'n' to change)

      The -F option indicates that the tables take their data from files. The -p option specifies the directory search path for the source files. (In this case, the path is /nis+files.) The -d option specifies the NIS+ domain name. (In this case, the domain name is doc.com.)

      The NIS+ principal user is root. You must perform this task as superuser in this instance because this is the first time that you are going to populate the root master server's tables. The nispopulate script adds credentials for all members of the NIS+ admin group.

    2. Type the following command to populate the tables from NIS maps.


      master1# nispopulate -Y -d doc.com. -h salesmaster -a 130.48.58.111 
      -y sales.doc.com.
      NIS+ domain name : doc.com.
      NIS (YP) domain : sales.doc.com.
      NIS (YP) server hostname : salesmaster
      Is this information correct? (type 'y' to accept, 'n' to change)

      The -Y option indicates that the tables take their data from NIS maps. The -d option specifies the NIS+ domain name. The -h option specifies the NIS server's machine name. (In this case, the NIS server's name is salesmaster. You have to insert the name of a real NIS server at your site to create the sample domain.) The -a option specifies the NIS server's IP address. (In this case, the address is 130.48.58.111. You have to insert the IP address of a real NIS server at your site to create the sample domain.) The -y option specifies the NIS domain name. (In this case, the domain's name is sales.doc.com.; you have to insert the NIS domain name of the real NIS domain at your site to create the sample domain.)

      The NIS+ principal user is root. You must perform this task as superuser in this instance because this is the first time that you are going to populate the root master server's tables. The nispopulate script also adds credentials for all members of the NIS+ admin group.

  2. Type y (if the information returned on the screen is correct).

    Typing n causes the script to prompt you for the correct information. (See How to Change Incorrect Information When Setting Up NIS+ for what you need to do if the information is incorrect.)

    • If you performed substep a of Step a, you will see the following:


      Is this information correct?
      (type 'y' to accept, 'n' to change) 
      y
      
      This script will populate the following NIS+ tables for domain doc.com. from 
      the files in /nis+files: auto_master auto_home ethers group hosts networks 
      passwd protocols services rpc netmasks bootparams netgroup aliases shadow
      **WARNING: Interrupting this script after choosing to continue may leave 
      the tables only partially populated. This script does not do any automatic 
      recovery or cleanup.
      Do you want to continue? (type 'y' to continue, 'n' to exit this script)
    • If you performed substep b of Step b, you will see the following:


      Is this information correct? (type 'y' to accept, 'n' to change)
      y
      This script will populate the following NIS+ tables for domain doc.com. from the 
      NIS (YP) maps in domain sales: auto_master auto_home ethers group hosts networks 
      passwd protocols services rpc netmasks bootparams netgroup aliases
      **WARNING: Interrupting this script after choosing to continue may leave the
       tables only partially populated. This script does not do any automatic recovery 
      or cleanup.
      Do you want to continue? (type 'y' to continue, 'n' to exit this script)
  3. Type y to continue populating the tables.

    By typing n, you can safely stop the script. If you interrupt the script after you have chosen y, while the script's running, the script stops running and can leave the tables only partially populated. The script does not do any automatic recovery or cleaning up.

    When you rerun the script, the tables are overwritten with the latest information.

    • If you are populating tables from files, you see messages like the following as the script uses hosts and passwd information to create the credentials for hosts and users:


      Do you want to continue? (type 'y' to continue, 'n' to exit this script) 
      y
      populating auto_master table from file /nis+files/auto_master
      ... auto_master table done. 
      populating auto_home table from file /nis+files/auto_home
      ... auto_home table done.
      Credentials have been added for the entries in the hosts and passwd table(s).
      Each entry was given a default network password (also known as a Secure-
      RPC password). This password is: nisplus
      Use this password when the nisclient script requests the network password.
      Done!

      Note and remember the Secure RPC password (nisplus, in the above example). Use this password when prompted for your network or Secure RPC password.

      The script continues until it has searched for all the files it expects and loads all the tables it can from the available files.

    • If you are populating tables from NIS maps, you will see messages like the following as the script uses hosts and passwd information to create the credentials for hosts and users:


      Do you want to continue? (type 'y' to continue, 'n' to exit this script)
      y
      populating auto_master table from sales.doc.com. NIS(YP) domain... 
      auto_master table done. 
      populating auto_home table from file sales.doc.com. NIS(YP) domain...
      auto_home table done.
      ....
      Credentials have been added for the entries in the hosts and passwd table(s).
      Each entry was given a default network password (also known as a Secure-RPC password). 
      This password is: nisplus
      Use this password when the nisclient script requests the network password.
      Done!

      Note and remember the Secure RPC password (nisplus, in the above example). Use this password when prompted for your network or Secure RPC password.

      All the tables are now populated. You can ignore any parse error warnings. Such errors indicate that NIS+ found empty or unexpected values in a field of a particular NIS map. You may want to verify the data later after the script completes.

  4. (Optional) Add yourself and others to the root domain's admin group.

    For example, if your login ID is topadm and your co-worker's ID is secondadmin, you enter:


    master1# nisgrpadm -a admin.doc.com. topadm.doc.com. secondadm.doc.com.
    Added “topadm.doc.com.” to group “admin.doc.com.”.
    Added “secondadm.doc.com.” to group “admin.doc.com.”.

    The admin.doc.com. argument in the nisgrpadm -a command above is the group name, which must come first. The remaining two arguments are the names of the administrators.


    Note –

    This step is necessary only if you want to add additional users to the admin group now, which is a good time to add administrators to the root server. You can also add users to the admin group after you have configured NIS+.


    You do not have to wait for the other administrators to change their default passwords to perform this step; however, they must already be listed in the passwd table before you can add them to the admin group. Members of the admin group will be unable to act as NIS+ principals until they add themselves to the domain. See How to Initialize an NIS+ User for more information on initializing users. The group cache also has to expire before the new members become active.

  5. Type the following command to checkpoint the domain.


    master1# nisping -C doc.com.
    Checkpointing replicas serving directory doc.com.
    Master server is master1.doc.com.
     Last update occurred at date
    Master server is master1.doc.com.
    checkpoint scheduled on master1.doc.com.

    This step ensures that all the servers supporting the domain transfer the new information from their initialization (.log) files to the disk-based copies of the tables. Since you have just configured the root domain, this step affects only the root master server, as the root domain does not yet have replicas.


    Caution – Caution –

    If you do not have enough swap or disk space, the server will be unable to checkpoint properly, but it will not notify you. One way to make sure everything is correct is to list the contents of a table with the niscat command. For example, to check the contents of the rpc table, type:


    master1# niscat rpc.org_dir
    rpcbind rpcbind 100000
    rpcbind portmap 100000
    rpcbind sunrpc 100000

    If you do not have enough swap space, you will see the following error message instead of the sort of output you see above.


    can't list table: Server busy, Try Again.

    Even though it does not say so, in this context this message indicates that you do not have enough swap space. Increase the swap space and checkpoint the domain again.


Setting Up NIS+ Client Machines

After the root master server's tables have been populated from files or NIS maps, you can initialize NIS+ client machines. (Because the root master server is an NIS+ client of its own domain, no further steps are required to initialize it.) This section shows you how to initialize an NIS+ client by using the nisclient script with default settings.

The script uses:


Note –

The -i option used in How to Initialize a New NIS+ Client Machine does not configure an NIS+ client to resolve host names requiring DNS. You need to explicitly include DNS for clients in their name service switch files.


ProcedureHow to Initialize a New NIS+ Client Machine

Before You Begin

Before you use the nisclient script, be sure the following prerequisites have been met.

You need the following information to run nisclient.

  1. Optionally, if using DES authentication, specify the Diffie-Hellman key length.

    On the master server, type


    nisauthconf

    Use the output as the arguments when running the nisauthconf command on the client. For example, if nisauthconf on the master server produces


    dh640dh-0 des

    type the following command on the client machine


    nisauthconf dh640dh-0 des
  2. Type the following command to initialize the new client on the new client machine.

    The -i option initializes a client. The -d option specifies the new NIS+ domain name. (If the domain name is not specified, the default is the current domain name.) The -h option specifies the NIS+ server's host name.


    client1# nisclient -i -d doc.com. -h master1
    Initializing client client1 for domain “doc.com.”.
    Once initialization is done, you will need to reboot your machine.
    Do you want to continue? (type 'y' to continue, 'n' to exit this script)
  3. Type y.

    Typing n exits the script. The script prompts you only for the root server's IP address if there is no entry for it in the client's /etc/hosts or, prior to the Solaris 10 7/07 release, in the client's /etc/inet/ipnodes file.


    Do you want to continue? (type 'y' to continue, 'n' to exit this script)
    y
    Type server master1's IP address:
  4. Type the correct IP address, and press Return.

    This example uses the hypothetical address 123.123.123.123.


    Type server master1's IP address: 123.123.123.123
    setting up the domain information...
    setting up the name service switch information...
    At the prompt below, type the network password (also known as the 
    Secure-RPC password) that you obtained either from your administrator or 
    from running the nispopulate script.
     Please enter the Secure-RPC password for root:
  5. Type the Secure RPC password (also known as the network password) only if the Secure RPC password differs from the root login password.

    In this case, use the default, nisplus.

    The password does not echo on the screen. If you mistype it, you are prompted for the correct one. If you mistype it twice, the script exits and restores your previous network service. If this happens, try running the script again.


    Please enter the login password for root:
  6. Type the root password for this client machine.

    The password does not echo on the screen. (If the Secure RPC password and the root login password happen to be the same, you will not be prompted for the root login password.)

    Typing the root password changes the credentials for this machine. The RPC password and the root password are now the same for this machine.


    Please enter the login password for root:
    Wrote secret key into /etc/.rootkey
    Your network password has been changed to your login one.
    Your network and login passwords are now the same.
    Client initialization completed!!
    Please reboot your machine for changes to take effect.
  7. Reboot your new client machine.

    Your changes do not take effect until you reboot the machine.

    You can now have the users of this NIS+ client machine add themselves to the NIS+ domain.

Creating Additional NIS+ Client Machines

Repeat the preceding client-initiation procedure on as many machines as you like. To initiate clients for another domain, repeat the procedure but change the domain and master server names appropriately.

The sample NIS+ domain described in this chapter assumes that you will initialize four clients in the doc.com. domain. You are then going to configure two of the clients as non-root NIS+ servers and a third client as a root replica of the root master server of the doc.com. domain.


Note –

You always have to make a system into a client of the parent domain before you can make the same system a server of any type.


Initializing NIS+ Client Users

After a machine has become an NIS+ client, the users of that machine must add themselves to the NIS+ domain. Adding a user to the domain means changing the Secure RPC password to that user's login password. What actually happens is that the user's password and the Secure RPC password are bound together. This procedure uses the nisclient script.

ProcedureHow to Initialize an NIS+ User

Before You Begin

Before you use the nisclient script to initialize a user, be sure the following prerequisites have been met.

You need the following information to run nisclient.

  1. To become an NIS+ client, enter the following nisclient command while logged in as the user.


    user1prompt% nisclient -u
    At the prompt below, type the network password (also known as the 
    Secure-RPC password) that you obtained either from your administrator 
    or from running the nispopulate script.
    Please enter the Secure-RPC password for user1:
  2. Enter the Secure RPC password, which is nisplus in this case.

    The password does not echo on the screen.


    Please enter the login password for user1:
  3. Type the user's login password and press Return.

    The password does not echo on the screen.


    Your network password has been changed to your login one.
    Your network and login passwords are now the same

    This user is now an NIS+ client. You need to have all users make themselves NIS+ clients.

Setting Up NIS+ Servers

Now that the client machines have been initialized, you can change any of them to NIS+ servers of the following types:


Note –

You can have only one NIS+ master root server. Root NIS+ servers are a special type of NIS+ server. This section does not describe how to configure a root master server; see Setting Up NIS+ Root Servers for more information.


You can configure servers any of these different ways:

Servers and their replicas should have the same NIS-compatibility settings. If they do not have the same settings, a client that needs NIS compatibility set to receive network information may not be able to receive it if either the server or replica it needs is unavailable.

Configuring a Client as an NIS+ Server

Perform any of the following to alternate procedures to configure a client as a server. These procedures create a directory with the same name as the server and create the server's initialization files which are placed in /var/nis.


Note –

All servers in the same domain must have the same NIS-compatibility setting. For example, if the master server is NIS compatible, then its replicas should also be NIS compatible.


ProcedureHow to Configure an NIS+ Server Without NIS Compatibility

Before You Begin

You need to be superuser or establish an equivalent role to perform this procedure.

You need the superuser password of the client that you will convert into a server before you can start the NIS+ service by using the svcadm command.

  1. View the /lib/svc/method/nisplus file to verify that the -Y option does not appear.

    See NIS+ and the Service Management Facility for more information.

  2. Start the NIS+ service.

    You need to be superuser or establish an equivalent role to perform this step.


    client1# svcadm enable /network/rpc/nisplus:default
    

    Now this server is ready to be designated a master or replica of a domain.

ProcedureHow to Configure an NIS+ Server With NIS Compatibility

You need to be superuser or establish an equivalent role to perform this procedure.

  1. Edit the /lib/svc/method/nisplus file on the server to add the -Y option.

    See NIS+ and the Service Management Facility for more information.

  2. Start the NIS+ service.

    You need to be superuser or establish an equivalent role to perform this step.


    client1# svcadm enable /network/rpc/nisplus
    

    Now this server is ready to be designated a master or replica of a domain.

ProcedureHow to Configure an NIS+ Server With DNS Forwarding and NIS Compatibility

This procedure configures an NIS+ server with both DNS forwarding and NIS compatibility. Both of these features are needed to support SunOS 4 clients.

You need to be superuser or establish an equivalent role to perform this procedure.

  1. Edit the /lib/svc/method/nisplus file on the server to add the -Y and -B options.

    See NIS+ and the Service Management Facility for more information.

  2. Start the NIS+ service.

    You need to be superuse,r or establish an equivalent role, to perform this step.


    client1# svcadm enable /network/rpc/nisplus:default
    

Creating Additional NIS+ Servers

Repeat the preceding client-to-server conversion procedure on as many client machines as you like.

The sample NIS+ domain described in this chapter assumes that you will convert three clients to servers. You will then configure one of the servers as a root replica, another as a master of a new subdomain, and the third as a replica of the master of the new subdomain.

Creating an NIS+ Root Replica Server

To have regularly available NIS+ service, you should always create one or more root replica servers. Having replicas can also speed network-request resolution because multiple servers are available to handle requests.

For performance reasons, you should have no more than a few replicas per domain.

If your network includes multiple subnets or different sites connected by a Wide Area Network (WAN), you may need additional replicas:

See Creating an NIS+ Root Replica Server for additional information on how to determine the optimum number of replicas.

How to Create an NIS+ Root Replica shows the machine client1 being configured as a root replica for the doc.com. domain. This procedure uses the NIS+ nisserver script. (You can also use the NIS+ command set to configure a replica server as described in Using NIS+ Commands to Configure a Replica Server.)

ProcedureHow to Create an NIS+ Root Replica

Before You Begin

You need the following information to run nisserver.

Before you run nisserver to create a replica, be sure the following prerequisites have been met.

  1. To create a root replica, type the following command as superuser (root) on the NIS+ domain's root master server.


    master1# nisserver -R -d doc.com. -h client1
    This script sets up an NIS+ replica server for domain doc.com.
    Domain name: :doc.com.
    NIS+ server	: :client1
    Is this information correct? (type 'y' to accept, 'n' to change)

    The -R option indicates that a replica should be configured. The -d option specifies the NIS+ domain name (doc.com., in this example). The -h option specifies the client machine (client1, in this example) that will become the root replica.

  2. Type y to continue.

    Typing n causes the script to prompt you for the correct information. (See How to Change Incorrect Information When Setting Up NIS+ for what you need to do if you type n.)


    Is this information correct? (type 'y' to accept, 'n' to change) 
    y
    This script will set up machine “client1” as an NIS+ replica server for domain 
    doc.com. without NIS compatibility. The NIS+ server daemon, rpc.nisd, must 
    be running on client1 with the proper options to serve this domain. 
    Do you want to continue? (type 'y' to continue, 'n' to exit this script)
  3. Type y to continue.

    Typing n safely stops the script. The script will exit on its own if rpc.nisd is not running on the client machine.


    Is this information correct? (type 'y' to continue, 'n' to exit this script)
    y
    The system client1 is now configured as a replica server for domain doc.com..
    The NIS+ server daemon, rpc.nisd, must be running on client1 with the proper 
    options to serve this domain. ... 

    Note –

    If you want to run this replica in NIS (YP) compatibility mode, modify the /lib/svc/method/nisplus file to add the -Y option. The file needs modification only if you want the root replica to fulfill NIS client requests and it was not already configured as an NIS-compatible server. See Configuring a Client as an NIS+ Server for more information about creating NIS-compatible servers and NIS+ and the Service Management Facility for more information about using Service Management Facility commands with NIS+.


  4. [Optional] Configure the replica to run in NIS (YP) compatibility mode.

    If you want this replica to run in NIS compatibility mode, follow these steps:

    1. Stop the NIS+ service.


      # svcadm disable /network/rpc/nisplus:<instance>
      
    2. Edit the server's /lib/svc/method/nisplus file to add the -Y option.

    3. Restart the NIS+ service.


      # svcadm enable /network/rpc/nisplus:<instance>
      
  5. Load your namespace data on to the new replica server.

    You can do this in two ways:

    • The preferred method of loading data on to a new replica server is to use the NIS+ backup and restore capabilities to back up the master server, then “restore” that data on to the new replica server. This step is described in detail in How to Load NIS+ Namespace Data by Using the nisrestore Command.

    • Run nisping. Running nisping initiates a full resynch of all NIS+ data from the master server to this new replica. If your namespace is large, this can take a long time, during which your master server is very busy and slow to respond and your new replica is unable to answer NIS+ requests. This step is described in detail in How to Load NIS+ Namespace Data by Using the nisping Command.

    When you have finished loading your namespace data, the machine client1 is now an NIS+ root replica. The new root replica can handle requests from the clients of the root domain. Because there are now two servers available to the domain, information requests can be fulfilled faster.

    Using these procedures, you can create as many root replicas as you need. You can also use these procedures to create replica servers for subdomains.

ProcedureHow to Set Up Multihomed NIS+ Replica Servers

The procedure for setting up a multihomed NIS+ server is the same as setting up a single interface server. The only difference is that there are more interfaces that need to be defined in the hosts database, the /etc/hosts file and NIS+ hosts table.


Note –

Prior to the Solaris 10 7/07 release, you also need to define interfaces in the /etc/inet/ipnodes file and ipnodes table.


Once the host information is defined, use the nisclient and nisserver scripts to set up the multihomed NIS+ server.


Caution – Caution –

When setting up a multihomed NIS+ server, the server's primary name must be the same as the nodename for the system. This is a requirement of both Secured RPC and nisclient.

If these names are different, Secure RPC authentication will fail to work properly causing NIS+ problems.


This procedure shows how to set up any NIS+ non-root master servers. The following example creates a replica for the root domain. For information about setting up a multihomed root server, see How to Set Up a Multihomed NIS+ Root Master Server.

  1. Add the server host information into the hosts file.


    Note –

    Prior to the Solaris 10 7/07 release, you must also load IPv6 server host information into the client's ipnodes file.


    For example, for the hostB system with three interfaces:


    192.168.11.y hostB hostB-11
    192.168.12.x hostB hostB-12
    192.168.14.z hostB hostB-14
     
  2. On the root master server, use either nispopulate or nisaddent to load the new host information into the hosts file.


    Note –

    Prior to the Solaris 10 7/07 release, you must also load host IPv6 information into the client's ipnodes table.


    For example:


    hostA# nispopulate -F -d sun.com hosts
    

    where the example shows sun.com as the NIS+ root domain name. Issue the nispopulate command specifying the name of your NIS+ root domain name.

  3. On the root master server, use the nisclient script to create the credential for the new client.

    For example:


    hostA# nisclient -c -d sun.com hostB
    

    where the example shows sun.com as the root domain name. Issue the nisclient command specifying the name of your root domain name.

  4. On the non-root master server, use nisclient to start the new server if it is not already running and initialize the machine as an NIS+ client.

    For example:


    hostB# nisclient -i -d sun.com
    

    where the example shows sun.com as the root domain name. Issue the nisclient command specifying the name of your root domain name.

  5. On the root master server, use nisserver to create a non-root master.

    For example:


    hostA# nisserver -M -d eng.sun.com -h hostB.sun.com.
    

    where the example shows eng.sun.com as the NIS+ domain name and hostB.sun.com as the fully-qualified hostname for the NIS+ server. Issue the nisserver command specifying the name of your NIS+ domain and the fully-qualified hostname for the NIS+ server.

  6. On the root master server, use nisserver to set up a replica server.

    For example:


    hostA# nisserver -R -d sun.com -h hostB.sun.com.
    

    where the example shows sun.com as the replica server and hostB.sun.com as the fully-qualified hostname for the NIS+ server. Issue the nisserver command specifying the name of your replica server and NIS+ domain.

    After completing the steps for setting up a multihome NIS+ replica server, the remainder of the setup is exactly the same as for a single interface server.

Creating an NIS+ Subdomain

This section shows you how to create the master server of a new non-root domain. The new domain will be a subdomain of the doc.com. domain. The hierarchical structure of NIS+ allows you to create a domain structure that parallels your organizational structure.

This example shows the machine client2 being converted to the master server of the new sub.doc.com. domain. This procedure uses the NIS+ script nisserver.

In Solaris release 2.6 and earlier, any NIS+ client can be converted to an NIS+ master server as long as it is itself in a domain above the domain it is serving. For example, an NIS+ client in domain sales.doc.com. can serve domains below it in the hierarchy, such as the west.sales.doc.com. or even the alameda.west.sales.doc.com. domains. This client cannot, however, serve the domain doc.com., because doc.com. is above the domain sales.doc.com. in the hierarchy. Root replicas are the only exception to this rule. They are clients of the domain that they serve.

In the Solaris 7 release, the domain name of any non-root NIS+ server can be set to the domain it serves. The non-root server behaves as if it lives in its own domain. This allows you to configure applications on the non-root server to use the information provided by the domain above it in the hierarchy.

The non-root server's credentials must still be in the domain above it in the hierarchy. Configure the non-root servers as described in How to Create a New Non-Root NIS+ Domain. Only after the servers are properly configured, can you change the domainname to that of the domain it serves. See the -k option of nisinit and the -d option of nisserver.

ProcedureHow to Create a New Non-Root NIS+ Domain

Before You Begin

You need the following information to run nisserver to create a master server for a non-root domain.

Before you run the nisserver command to create a master server for a new non-root domain, be sure the following prerequisites have been met.

  1. Type the following command as superuser (root) on the NIS+ domain's root master server to create a new non-root domain master server.

    The -M option indicates that a master server for a new non-root domain should be created. The -d option specifies the new domain name, sales.doc.com. in this instance. The -h option specifies the client machine, (client2, in this example), that will become the master server of the new domain.


    master1# nisserver -M -d sales.doc.com. -h client2
    This script sets up a non-root NIS+ master server for domain sales.doc.com.
    Domain name : sales.doc.com.
    NIS+ server : client2
    NIS+ group : admin.sales.doc.com.
    NIS (YP) compatibility : OFF
    Security level : 2=DES
    Is this information correct? (type 'y' to accept, 'n' to change)

    Master servers of new non-root domains are created with the same set of default values as root servers. See How to Create an NIS+ Root Master Server for more information on NIS+ group, NIS compatibility, and security level.

  2. Type y to continue.

    Typing n causes the script to prompt you for the correct information. (See How to Change Incorrect Information When Setting Up NIS+ for what you need to do if you type n.)


    Is this information correct? 
    (type 'y' to accept, 'n' to change) y
    This script sets up machine “client2” as an NIS+ non-root master 
    server for domain sales.doc.com.
    Do you want to continue? (type 'y' to continue, 'n' to exit this script)
  3. Type y to continue.

    Typing n safely exits the script. The script exits on its own if rpc.nisd is not running on the client machine.


    Do you want to continue? (type 'y' to continue, 'n' 
    to exit this script) 
    y
    running nissetup ...
    org_dir.sales.doc.com. created
    groups_dir.sales.doc.com. created
    ...
    ...
    setting NIS+ group admin.sales.doc.com. ...
    The system client2 is now configured as a non-root server for 
    domain sales.doc.com.
    You can now populate the standard NIS+ tables by using the 
    nispopulate or /usr/lib/nis/nisaddent commands. 

    The machine client2 is now the master server of the sales.doc.com. domain. The sales.doc.com. domain is a subdomain of the doc.com. domain. The machine client2 is simultaneously still a client of the root domain doc.com., and the master server of the sales.doc.com. domain.

    You can now populate the standard NIS+ tables on the new master server of the sales.doc.com. domain.

Creating Additional NIS+ Domains

Repeat the preceding procedure for changing servers to master servers of new non-root domains on as many server machines as you like. Every new master server is a new domain. Plan your domain structure before you start creating an NIS+ namespace. See Structure of the NIS+ Namespace for more information on planning an NIS+ hierarchy.

Populating the New NIS+ Subdomain's Tables

After you have created a new domain, you need to populate its master server's standard NIS+ tables. You use the same procedure to populate the new master server's tables as you used to populate the root master server's tables. The major difference is that the nispopulate script is run on the new master server instead of on the root master server. The domain names and file paths or NIS servers' names may change as well.

This example shows the tables of the new domain, sales.doc.com., being populated.

Prerequisites to Populating a NIS+ Subdomain's Tables

Before you run the nispopulate script to populate the new master server's tables, be sure the following prerequisites have been met.


Note –

The nispopulate script can fail if there is insufficient /tmp space on the system. To keep this from happening, you can set the environment variable TMPDIR to a different directory. If TMPDIR is not set to a valid directory, the script uses the /tmp directory instead.


Populating the NIS+ Master Server Tables

Since this procedure is essentially the same as the procedure shown in How to Populate the NIS+ Root Master Server Tables, this example shows you only what you would type to populate the tables of the new sales.doc.com. domain. For more information about this procedure, see How to Populate the NIS+ Root Master Server Tables.


Note –

This script should be run on the new domain's master server, not the root master server.


The alternate methods of populating the master server tables on the new master server are:

The information that you need to gather depends upon whether you are populating from files or from NIS maps.

Whichever method you choose should be executed in a scrolling window as the script's output might otherwise scroll off the screen.

How to Populate the NIS+ Tables From Files

If populating from files, you need the following information.

To populate master server tables from files, type the following commands.


client2# nispopulate -F -p /nis+files -d sales.doc.com.
NIS+ domain name : sales.doc.com.
Directory Path : /nis+files
Is this information correct? (type 'y' to accept, 'n' to change

How to Populate the NIS+ Tables From NIS Maps

If populating from NIS maps, you need the following information.


Note –

The NIS domain name is case-sensitive, while the NIS+ domain name is not.


To populate master server tables from NIS maps, type the following commands.


client2# nispopulate -Y -d sales.doc.com. -h businessmachine -a 
IP_addr_of_NIS_server -y business.doc.com.
NIS+ Domain name : sales.doc.com.
NIS (YP) domain : business.doc.com.
NIS (YP) server hostname : businessmachine
Is this information correct? (type 'y' to accept, 'n' to change)

See How to Populate the NIS+ Root Master Server Tables for additional information.

Creating NIS+ Subdomain Replicas

The same principles that apply to root domain replicas apply to subdomain replicas (see Creating an NIS+ Root Replica Server).

You use the same procedure to create a subdomain replica as you do to create a root replica. The major difference between creating the root replica and a subdomain replica is that the machine you are going to convert to a subdomain replica remains a client of the domain above the one it serves as a replica. This example shows you only what you type to create a replica for the new domain. For the rest of the script's output, see How to Create an NIS+ Root Replica.

ProcedureHow to Create an NIS+ Replica

Before You Begin

Before you run nisserver to create a replica, be sure the following prerequisites have been met.

You need the following information to run nisserver.

  1. Run the nisserver -R command as superuser (root) on the NIS+ domain's master server.


    client2# nisserver -R -d sales.doc.com. -h client3
    This script sets up an NIS+ replica server for domain sales.doc.com.
    Domain name 	::sales.doc.com.
    NIS+ server :client
    Is this information correct? (type 'y' to accept, 'n' to change)

    In this example, client2 is the master server. The -R option indicates that a replica should be configured. The -d option specifies the NIS+ domain name (sales.doc.com. in this example). The -h option specifies the client machine (client3, in this example) that will become the replica. Notice that this machine is still a client of the doc.com. domain and not a client of the sales.doc.com. domain.

    See How to Create an NIS+ Root Replica for the rest of this script's output.

Initializing NIS+ Subdomain Client Machines

After the master server's tables have been populated from files or NIS maps, you can initialize an NIS+ client machine. This section shows you how to initialize an NIS+ client in the new domain using the nisclient script with default settings. The NIS+ client machine is a different machine from the NIS+ master server.


Note –

The -i option used in How to Initialize an NIS+ Subdomain Client Machine does not configure an NIS+ client to resolve host names requiring DNS. You need to explicitly include DNS for clients in their name service switch files.


You use the same procedure to initialize a client in the new domain as you do to initialize a client in the root domain. This example shows you only what you would type to initialize a client for the new domain. For the rest of the script's output, see How to Initialize a New NIS+ Client Machine.

ProcedureHow to Initialize an NIS+ Subdomain Client Machine

Before You Begin

Before you use the nisclient script to initialize a client machine, be sure the following prerequisites have been met.

You need the following information to run nisclient.

  1. Type the following command as superuser to initialize the new client on the new client machine.


    subclient1# nisclient -i -d sales.doc.com. -h client2
    Initializing client subclient1 for domain “sales.doc.com.”.
    Once initialization is done, you will need to reboot your machine.
    Do you want to continue? (type 'Y' to continue, 'N' to exit this script)

    The -i option initializes a client. The -d option specifies the new NIS+ domain name. (If the domain name is not specified, the default becomes the current domain name.) The -h option specifies the NIS+ server's host name.

    See How to Initialize a New NIS+ Client Machine for the rest of this script's output.

Initializing an NIS+ Subdomain Client Users

You use the same procedure (nisclient) to initialize a user in the new domain as you do to initialize a user in the root domain. All users must make themselves NIS+ clients. This example shows you only what you would type to initialize a user for the new domain. For the rest of the script's output, see How to Initialize an NIS+ User.

ProcedureHow to Initialize an NIS+ Subdomain User

Before You Begin

Before you use the nisclient script to initialize a user, be sure the following prerequisites have been met.

You need the following information to run the nisclient command.

  1. To become an NIS+ client, type the following command while logged in as the user.


    user2prompt% nisclient -u
    At the prompt below, type the network password (also known as the 
    Secure-RPC password) that you obtained either from your administrator 
    or from running the nispopulate script.
    Please enter the Secure-RPC password for user2:

    See How to Initialize an NIS+ User for the rest of this script's output.

Summary of Commands for the Sample NIS+ Namespace

Table 4–4 summarizes the actual commands that you typed to create the sample namespace. The prompt preceding each command indicates on which machine the command should be typed.

Table 4–4 Creating the Sample NIS+ Namespace: Command Summary

Tasks 

Commands 

Set environment path to include /usr/lib/nis – C shell or Bourne shell.

# setenv PATH $PATH:/usr/lib/nis

or 

# PATH=$PATH:/usr/lib/nis; export PATH

Optionally configure Diffie-Hellman key length. 

master1# nisauthconf dh640-0 des

Create root master server for doc.com. domain.

master1# nisserver -r -d doc.com.

Populate the root master server's NIS+ tables – from files or from NIS maps. 

master1# nispopulate -F -p /nis+files -d doc.com.

or 

master1# nispopulate -Y -d doc.com. -h salesmaster -a \ 172.31.58.111 -y sales.doc.com.

Add additional members to the admin group (2). 

master1# nisgrpadm -a admin. doc.com. topadmin.doc.com. \ secondadmin.doc.com.

Make a checkpoint of the NIS+ database. 

master1# nisping -C org_dir. doc.com.

Optionally configure Diffie-Hellman key length. 

client1# nisauthconf dh640-0 des

Initialize an NIS+ client machine in the doc.com. domain. 

client1# nisclient -i -d doc.com. -h master1

Initialize user as an NIS+ client. 

client1user1prompt% nisclient -u

Convert NIS+ client to NIS+ server, without or with NIS compatibility or with NIS and DNS. 

client1#rpc.nisd

or 

client1# rpc.nisd -Y

or 

client1# rpc.nisd -Y -B

Create a root replica. 

master1# nisserver -R -d doc.com. -h client1

Convert a server to a non-root master server of the sales.doc.com. domain.

master1# nisserver -M -d sales.doc.com. -h client2

Populate the new master server's NIS+ tables – from files or from NIS maps. 

client2# nispopulate -F -p /nis+files -d sales.doc.com.

or 

client2# nispopulate -Y -d sales.doc.com. -h \ businessmachine -a 172.31.58.242 -y business.doc.com.

Create a master server replica. 

client2# nisserver -R -d sales.doc.com. -h client3

Initialize an NIS+ client in the sales.doc.com. domain.

subclient1# nisclient -i -d sales.doc.com. -h client2

Initialize user as an NIS+ client. 

subclient1user2prompt% nisclient -u