You need the following information to run nisserver to create a master server for a non-root domain.
The client machine name (client2, in this example)
The superuser password for the parent master server
A name for the new non-root domain – the name of the new domain includes the name of the parent domain with this syntax: newdomain.rootdomain
In How to Create a New Non-Root NIS+ Domain, the new non-root domain is called sub.doc.com.
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.
The parent domain must already have been configured and its master server must be running.
The parent domain's tables must be populated. (At a minimum, the hosts table must have an entry for the new client machine.)
You must have initialized the new client machine in the parent domain.
You must have adequate permissions to add the new domain. In this case, you must be logged in as root on the parent master server. In this example, the parent master machine is named master1.
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.
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)
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.