Server Configuration For NIS | Setup NIS Server

NIS Network Information Authentication is used for maintain the Network Authentication.NIS  will handle the all the required files /etc/passwd /etc/group /etc/hosts for user authentication.
Install Ypserv Package For Maintain The NIS
1)[script@redhat yp]# yum install yp*
upate the NIS Domain Name in /etc/sysconfig/network
2)[script@redhat html]# vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=redhat.localdomain
NISDOMAIN=rhel5
3)[script@redhat yp]# vi /var/yp/Makefile
Int the 109 line [ Line number may change so you can search word hosts]
Before changes:ll: passwd group hosts rpc services netid protocols mail \
Add # symbol before the hosts
After Changes:ll: passwd group #hosts rpc services netid protocols mail \
Restart the Following service
4)[script@redhat ~]# service portmap restart
5)[script@redhat ~]# service ypserv restart

Then run the /usr/lib/yp/ypinit -m command it will ask what are host add to the nis client

6)[script@redhat yp]# /usr/lib/yp/ypinit -mAt this point, we have to construct a list of the hosts which will run NIS
servers.  redhat.example.com is in the list of NIS server hosts.  Please continue to add
the names for the other hosts, one per line.  When you are done with the
list, type a .
next host to add:  redhat.example.com
next host to add:  
Just type (ctrl+d)
The current list of NIS servers looks like this:
redhat.example.com
Is this correct?  [y/n: y]  y  [Type Y-yes then it will build the database]
We need a few minutes to build the databases...
Building /var/yp/rhel5/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/rhel5'
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
gmake[1]: Leaving directory `/var/yp/rhel5'

redhat.example.com has been set up as a NIS master server.
Now you can run ypinit -s redhat.example.com on all slave server.

Here redhat as system name, example.com as domain name for DNS setting hostname.NIS Domain name as rhel5
Start the yppasswdd service it will update there username and there password.
 7)[script@redhat yp]# service yppasswdd start
Starting YP passwd service: [ OK ]
After yppasswd service start
it will create the folder as rhel5 in /var/yp directory.
/var/yp/rhel5
yppasswdd it is used to update the client password in the database
After start the service add the user.
now I add the user as nisclient in NIS server.

[script@redhat yp]# useradd nisclient
[script@redhat yp]# passwd nisclient
Changing password for user nisclient.
New UNIX password: 
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.
Update The Ypserv Database File
 8)[script@redhat yp]# cd /var/yp/
[script@redhat yp]# make [Make command it will update the Database file]
gmake[1]: Entering directory `/var/yp/rhel5'
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
gmake[1]: Leaving directory `/var/yp/rhel5'
It will update the nis user name and there password.
For configure NIS client
Refer the below link
http://studentwebsite.blogspot.com/2010/05/configure-setup-nis-client-rehl5.html ypinit -install build the program

Related post