NIS/YPThe Network Information Service or NIS (originally called Yellow Pages or YP) is a client-server directory service protocol for distributing system configuration data such as users, groups, or host names between computers.

Typically, NIS becomes invaluable when you have a local area network with a number of systems that are used by a particular group of users. Using NIS, you can share user accounts, groups, and host files so that users can easily login to the various systems. For example, when a user updates their password on one system, it automatically takes effect on all other systems.

An "NIS Domain" comprises of at least one NIS server, and a number of NIS clients.

The Master server maintains the authoritative copies of system files, which are kept in their original locations and formats (flat files), which can be edited by standard means. A server process makes the contents of its files (NIS maps) available over the network.

Slave servers keep a copies of the master server's NIS maps for redundancy and load balancing.

Finally, clients get their maps (eg. /etc/passwd, /etc/group) from one of the servers (master or slave).

Setting up an NIS Server
To set up an NIS server, you will need the following packages installed:

yum install ypserv ypbind portmap yp-tools

The NIS domain needs to be added in the /etc/sysconfig/network configuration file. Edit the file and add the following line to the end of the file, replacing "mydomain" with whatever you would like to call your domain:
NISDOMAIN="mydomain"

The NIS Server also needs to be set up as a client of itself. Edit the /etc/yp.conf config file and add the following line:
ypserver 127.0.0.1

Start the following daemons, and configure them to autostart on boot-up:
service portmap start
service yppasswdd start
service ypserv start
chkconfig portmap on
chkconfig yppasswdd on
chkconfig ypserv on

Now generate the NIS database from your existing flat files:
/usr/lib/yp/ypinit -m

Now run the command:
authconfig-tui
This lets the user customise the system to use various authentication methods, including NIS. Enter the domain name as the one which is used previously, and "localhost" as the NIS server.

The services ypbind and ypxfrd are required. Use the following commands to start them, and set them up to start on boot-up:
service ypbind start
service ypxfrd start
chkconfig ypbind on
chkconfig ypxfrd on

Setting up an NIS client
The following packages need to installed for a system to act as an NIS client:
yum install ypbind yp-tools

As before, run the following command to configure this system to use NIS for authentication:
authconfig-tui
This lets the user customise the system to use various authentication methods, including NIS. Enter the domain name as the one which is used previously, and "localhost" as the NIS server.

Now start the ypbind service, and configure it to autostart on boot up:
service ypbind start
chkconfig ypbind on

Et viola! You should now be able to login to any NIS client using login credentials stored on the NIS master. You might want to take a look at automountd now, to allow for automatic network mounting of users home directories!