Configure NIS Server CentOS 6

Configure NIS Server CentOS 6

Configure NIS Server CentOS 6

NIS or Network Information Service is an Older Directory Protocol that was used Before LDAP and Active Directory. The concept is simple, have a central server that can manage a set of user accounts for a wide array of machines.

–It’s important to understand that NIS should ONLY be used internally (or better yet, not at all) NIS is not horribly secure, anyone connected to NIS can take a copy of the password database and decrypt it, therefore only use NIS where you absolutely need to.

NIS is where “yellowpages” started, a global lookup for names

login as root

Root shell prompt on the CentOS 6 NIS server

install the yellowpages server (NIS)

yum -y install ypserv

once installed, we need to edit network settings

ypserv installed, then vi /etc/sysconfig/network

append the below line NISDOMAIN (make up what you want)

/etc/sysconfig/network with NISDOMAIN=yourNISname.local appended

now we need to edit the yp.conf

vi /etc/yp.conf

add the following line:

yp.conf line ypserver 127.0.0.1

start the ypserv and yppasswdd services, and set them to start automatically

service ypserv and yppasswdd start, then chkconfig both on

also do the following so slave replication works:

service ypxfrd start and chkconfig ypxfrd on for slave replication

run RPCINFO to make sure the services are running

rpcinfo -p localhost listing portmapper, ypserv and yppasswdd

initialize the database with the following command:

/usr/lib64/yp/ypinit -m to initialize the NIS master database

here’s the full output

ypinit -m output building the maps, nis.zhosting.com set up as NIS master

FYI – Here’s the Log Directory

ls /var/yp/yourNISname.local showing the generated NIS map files

now we just need to install ypbind

yum -y install ypbind

set the service to start on reboot, and then start the service

chkconfig ypbind on and service ypbind start binding to the NIS domain

add a test user (or several at this point if you choose)

cd /var/yp and make rebuilding the passwd and group maps

This last step: MAKE INTO A SCRIPT to run in Cron Every 1 Minute (this adds users to the NIS database, otherwise the users you created will not be accessible via NIS)

cd /var/yp and make rebuilding the NIS maps, the command to run from cron

if you do the ypcat passwd this will show the users that are in the NIS database

ypcat passwd listing testuser from the NIS database

That’s it! Your NIS Server is ready to go!

configure your client using this article:

http://blog.zwiegnet.com/configure-nis-client-centos-6/

configure your NIS Slave using this article:

http://blog.zwiegnet.com/linux-server/configure-nis-slave-centos-6/

To get a Hosted Linux Server visit www.zwiegnet.com/go to get started today!

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *