NIS Configuration in Linux

The two common authentication servicesare the Network Information Service (NIS)
and the Lightweight directory Access Protocol (LDAP).

Both NIS and LDAP allows to manage all users &computer centrally.
it works with the help of sunrpc
here passwords are in clear text format. we normally use nfs along wuth nis to share users home directories from server to client for security purpose

Steps to configure nis

#yum install yp* -y
#service ypserv start
#chkconfig ypserv on
#service ypbind start
#service ypxfrd start
#service yppasswdd start

Change as follows

#vi /var/yp/Makefile
all:  passwd group hosts rpc services netid protocols mail
change as follows
all:  passwd group hosts
# rpc services netid protocols mail
save&quit
#/usr/lib/yp/ypinit -m (to make as master nis server)
ctrl+d
y (to create database)
#useradd user1
#useradd user2
#cd /var/yp
#make (to update database)

To set nisdomain name:

#nisdomainname RHCE
#vi /etc/sysconfig/network
add a new line
NISDOMAINNAME=RHCE
save&quit
#service network restart
#service ypxfrd restart
#service ypbind restart
#service yppasswdd restart
#service ypserv restart

(sharing home directories via nfs)

#yum install nfs-* -y
#service portmap start
#service portmap restart
#service nfs start
#chkconfig portmap on
#chkconfig nfs on
#vi /etc/exports
/home/u1    *.redhat.com(rw,sync)
save&quit
#service nfs restart
#exportfs -v
#exportfs -r

client side configuration:

#yum install yp-bind-* -y
#service ypbind start
#chkconfig ypbind on
#setup
select Authentication
select nis
provide nis domainname&nis server ip
#setsebool -P allow_ypbind 1
#vi /etc/auto.master
add a new line
/home    /etc/auto.misc
save7quit
u1  -rw,soft,intr     server1.redhat.com:/home/u1
save&quit
#service autofs restart
#getent passwd u1
# su – u1