How to Configure NIS Server and NIS Client in RHEL5

Posted: October 28, 2017 in SERVER
Tags: ,

In this tutorial i am going you to explain how to configure NIS server and NIS client in Redhat Enterprise Linux.I will mention step wise clear notes with command to configure NIS Server and NIS Client in this tutorial.before configuring NIS server you must configure Yum server on your Linux Machine.Using the same method you can configure NIS server on CentOS Linux or Fedora Linux.

IN this NIS Configuration LAB:

NIS  Server IP Address:           192.168.0.100

NIS Server Client IP Address:  192.168.0.200

NIS DOMAIN NAME:  LINUXTIWARY

NIS SERVER CONFIGURATION:

Step 1: Install Softwares required to configure NIS server using Yum.

#yum install yp-tools ypbind ypserv

Step 2:Configure NIS Domain name.

You must configure a NIS Domain name.remember NIS Domain Name is quite different the domain name.

#vim /etc/sysconfig/network

 

You can go the last line of this file and add the below line.

NISDOMAIN=”LINUXTIWARY”

 

Note:here LINUXTIWARY is my NIS DOMAIN NAME it will be different for you.You can assign any name as your NIS domain name.

 

Step 3:Now make NIS SERVER  a client of Itself.

#vim /etc/yp.conf

ypserver 192.168.0.100

 

remember here 192.168.0.100 is the ip of NIS Server and in this way NIS server has become its own client.

 

Step 4:Now it’s time to start the NIS server service.

#service portmap restart

#service yppasswdd restart

#service ypserv restart

 

#chkconfig portmap on

#chkconfig yppasswdd on

#ckconfig ypserv on

 

Step 5:Now it’s time to initialize the NIS Server using entire path.

#/usr/lib/yp/ypinit -m

 

Step 6: create User for NIS

#useradd satish

#passwd satish

 

Whenever we create any new user we need to run below command to make update.

#cd /var/yp

#make

 

Step 6:Start the below services

#service ypbind start
#service ypxfrd start
#chkconfig ypbind on
#chkconfig ypxfrd on

 

  NFS SERVER CONFIGURATION to share the home directory

remember NFS server configuration is optional.But i recommend you to configure it to share your home directory to centralize the users home directory.

Step 1:Install the package using yum.

#yum install nfs* portmap* -y

 

Step 2: Edit vim /etc/exports file

And add the below line

/home  *(rw,sync)

 

save the file and run below command to update the changes made to /etc/exports file.

#exportfs -av

 

Step 3: Restart NFS Services

#service portmap restart

#service nfs restart

#chkconfig portmap on

#chkconfig nfs on

if you find any problem must watch the video below.

 NIS CLIENT CONFIGURATION

Step 1:Install the required packages on NIS client using YUM.

 

Step 2:bind the NIS Client with NIS Domain using below command.

#authconfig  --enablenis   --nisdomain=LINUXTIWARY  --nisserver=192.168.0.100   --update

 

Step 3:configure automounting

#vim /etc/auto.master

/home     /etc/auto.home

 

Step 4:now create a file name auto.home inside /etc folder using vim command.

#vim /etc/auto.home

  •   -rw,soft       192.168.0.100/home

 

Step 5:Now restart the below service

#service autofs restart

#chkconfig autofs on

 

Now you will be able to login to NIS server through user created on NIS Server machine 192.168.0.100 from nis client 192.168.0.200

 

 

   FIREWALL AND SELINUX CONFIGURATION

Step 1:You can disable selinux using below command.

#setenforce 0

 

Step 2:You can disable or Flush firewall rules if you want.

#iptables -F

If you don’t want to FLUSG FIREWALL RULES you can configure your FIREWALL TO ALLOW NIS AND NFS Services.

#iptables -I INPUT -p udp --dport 1023 -j ACCEPT
#iptables -I INPUT -p udp --dport 111 -j ACCEPT

#iptables -I INPUT -p tcp --dport 2049 -j ACCEPT

# service iptables save

 

You can check or verify the port numbers using below command:

 

#rpcinfo -p

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s