To Setup and configure NIS on Redhat
Setup NIS Server
1. Look for ypserv packages and if it is not install install it.
# rpm -q ypserv*
If its not install follow the step,
# rpm -ivh ypserv*
2 . Enter the domain name in /etc/sysconfig/network file
# vi /etc/sysconfig/network
NISDOMAIN= lab.com
Save and quit
3. Edit the NIS client configuration file /etc/yp.conf
# vi /etc/yp.conf
ypserver 127.0.0.1
Save and quit
4. Start the NIS releated demons
# service portmap start
# service yppasswdd start
# service ypserv start
# chkconfig portmap on
# chkconfig yppasswdd on
# chkconfig ypserv on
5. Make sure all demons and service are running
# rpcinfo -p localhost
6. Initilize the NIS domain
# /usr/sbin/ypinit -m
next host to add : backup (give the master server host name)
next host to add : ^D
Message will appear backup is your master server.
7.Start the ypxfrd and ypbind demons
# service ypbind start
# service ypxfrd start
# chkconfig ypbind on
# chkconfig ypxfrd on
8. Make sure demons are running
# rpcinfo -p localhost
9 . Add a new user
# useradd -g users nisuser
passwd nisuser
10. Confiure autofa to share /home directory
# vi /etc/auto.master
/home /etc/auto.home
Save and quit.
# vi /etc/auto.home
* backup:/home/&
Save and quit.
Start auto fs service
# service autofs start
# chkconfig autofs on
11. Update the NIS domain authentication file in /var/yp
# cd /var/yp
# make
This will update the NIS authentication file
12. Now check user authentication is updated
# ypmatch nisuser passwd
Configure NIS Client
1.The authconfig-tui program automatically configures your NIS files after prompting you for the IP address and domain of the NIS server.
# authconfig -tui
2. Once finished, it should create an /etc/yp.conf file that defines, amongst other things, the IP address of the NIS server for a particular domain. It also edits the /etc/sysconfig/network file to define the NIS domain to which the NIS client belongs
# more /etc/yp.conf
# more /etc/sysconfig/network
3. Start NIS clients demons
# service portmap start
# service ypbind start
# chkconfig ypbind on
# chkconfig portmap on
Test NIS client access to NIS server
# ypmatch nisuser passwd
It will give the password home directory and all.
Try to login with the nisuser name from client
# su – nisuser
You will be in user’s home directory.

Leave a Reply