Monday, August 19

NIS Configuration in Linux (Redhat or CentOS 6)


                                    NIS (Network Information Server)

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
#vi /var/yp/Makefile
(change as follows)
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
NISDOMAIN=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

3 comments:

  1. Nice guide, but there's a slight error in the section about setting the NIS domain name. Rather than

    NISDOMAINNAME=RHCE

    it should be;

    NISDOMAIN = RHCE

    Thanks!

    ReplyDelete
  2. Ok , Its changed.

    ReplyDelete
  3. [root@server yp]# /usr/lib/yp/ypinit -m
    bash: /usr/lib/yp/ypinit: No such file or directory

    not able to find the ypinit ..can some one help me ...

    ReplyDelete

:: Linux - Legends ::