How to configure NIS server in cent os 6

To start configuration of NIS server for Centos 6 first rpcbind service should be installed and running.
verify the installation
# rpm -qa | grep -i rpcbind
if it did not returns any result please get this install first
# yum install rpcbind
# chkconfig rpcbind on
# /etc/init.d/rpcbind start

(Before going ahead let me tell you NIS stands for Network Information Service.
NIS is also called as YP. YP stands for Yellow Pages.This is primarily used as a central repository to hold all username and passwords (i.e /etc/passwd), and different servers can authenticate against this server for the username and password.)

moving on
Now install NIS packages
# yum install ypserv

edit network file  and set NISDOMAIN
# vim /etc/sysconfig/network
insert a line as bellow
NISDOMAIN=mydomain.com

Save & exit. Now start the service

# /etc/init.d/ypserv start
Now check that ypserv is running and registered with rpcbind
#  rpcinfo -u localhost ypserv
must return values as bellow
program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting

Now generate NIS database by ypinit command
# /usr/lib/yp/ypinit -m
Above command will show information and will ask you to accept them press y and this will build the database.
NIS database goes under /var/yp
you can give ls command to list files under this directory and you can see a file with the name as per your nisdomain name you have given.
You can verify database
# ypcat passwd
Above command will show nis users database updated as per your passwd file
next time for adding a new user simply give useradd command and make the nis database
# /var/yp/make

***************configure NIS client*******************
Your client hostname should be set as FQDN (client.mydomain.com in my case)
now edit network file to set NIS DOMAIN

# vim /etc/sysconfig/network
insert a line as bellow
NISDOMAIN=mydomain.com
Now edit yp.conf file to set  NIS server infomation
# vim /etc/yp.conf
domain mydomain.com server nis.mydomain.com    (change as per your)
start yp bind
#/etc/init.d/ypbind start
you can test client by using ypcat command
# ypcat passwd
should return all nis users as in your nis server


Comments

Popular posts from this blog

Running web ssh client on port 443 /80 with nginx as reverse proxy

Running cockpit behind nginx reverse proxy with nginx ssl and cockpit non ssl

Setup VOD streaming server with nginx using RTMP on Ubuntu 18.04