How to configure NIS server
To Set up an NIS server on your computer, you’ll need to install the ypserv and yp-tools RPM.
NIS clients and NIS servers are organized in NIS domains.If you are using NIS, you can find out the name of your NIS domain by using this command:
If this returns a blank or none, you’ll need to define the NIS domainfor your system with the following command :
# domainname nisdomain
NIS provides you with more than a shared authorization database.With NIS, you can provide shared access to any kind of information. By default NIS shares the following files:
You can configure NIS to share other files as well. This is easy to configure in the NIS configuration file, /var/yp/Makefile.
NIS services require at least one NIS master server where the centralized NIS database files, known as maps, are stored.
NIS changes require an update to the map on the master server.
You can have only one NIS master server per NIS domain.
For larger networks, you may also want an NIS slave server.NIS Server take copies of the NIS maps from the master server.
NIS clients can then get their configuration files from either the master server or a slave server.
You can have multiple NIS Slave Servers on a network.
NIS clients are systems that use information from NIS server. NIS clients don’t store any information that is contained in the NIS database; whenever that information is needed, it is retrieved from a server.
STARTING THE NIS SERVICE
Once you have edited the configuration files for your computer and network, you can start the NIS service. You can do so with the ypinit command in the /usr/lib/yp directory.
This command has two key switches
-m is used to create a master NIS server and
-s is used to create a slave NIS Slave.
# /usr/lib/yp/ypinit –m
Configuring NIS Server and NIS Client
Step 1. Assign 192.168.0.254 to NIS server and 192.168.0.1 to NIS client.
Step 2. Install ypserv, ypbind, and yp-tools packages by using RPM command
# rpm –q ypserv
# rpm –ivh ypserv-*
# rpm –ivh yp-tools*
# rpm –ivh ypbind*
Step 3. Edit /etc/sysconfig/network file to set your NIS domain name. This will take effect when you reboot your machine.
Step 4. To set NIS domain name without rebooting the machine run the command given below
# domainname nisdomain
Step 5. Start portmap and ypserv service by using the following commands:
# service portmap start
# service ypserv start
Step 6. Generate the NIS maps (database) by running ypinit as shown below
Step 7. Now start NIS password update daemon using the following command.
# service yppasswdd restart
Step 8. Create user name user1 and user2 by using adduser command
Step 9. Now go to /var/yp directory. Run make command it update your password and group information which is accessed by NIS client
# cd /var/yp
Configuring NFS Server
Step 1. Mount home directory in /etc/exports file
Step 2. Run exportfs –a to commit the job
Step 3. Now start nfs service
#service nfs restart
Client Side Configuration
Step 1. Use authconfig command to configure NIS client
Step 2. Test your NIS client log into the client machine as root. Test the client-server connection by typing