One, NIS definition
NIS (Network Information Service, Network information Services), also known as the YP (yellow Pages) protocol, is an RPC (remote procedure Call) application service that provides directory services. Through it, you can share a centralized password file on the network, which greatly simplifies the client user's maintenance of account and password.
Second, the experimental environment
Four CentOS5.4 servers, respectively, are:
One NIS Master Server
Machine Name: rhce1.eryin.com
IP Address: 192.168.1.83
One NIS Slave Server
Machine Name: rhce2.eryin.com
IP Address: 192.168.1.85
Two NIS Client
The machine name is: rhce3.eryin.com and rhce4.eryin.com
IP address correspondence above: 192.168.1.88, 192.168.1.89
Iii. steps for setting up NIS server
Note that the third part of the operation is on two NIS servers.
1. Install the required packages on NIS server:
#yum Install Portmap Ypserv
2. Set NIS domain name on NIS server:
Execute the following command individually:
#nisdomainname RHCE
#vi/etc/sysconfig/network, join the following line,
Nisdomain=rhce
3, set to restrict which computers can use NIS Server:
#vi/var/yp/securenets, enter the following:
255.255.255.0 192.168.1.0
The file format is:
Subnet Mask IP Address
The above setting represents that all servers in the 192.168.1.0 network segment can authenticate using NIS server.
4. Launch the services and settings used by NIS server to start automatically:
#service Ypserv Start
#service Portmap Start
#service Yppasswdd Start
#service YPXFRD Start
#chkconfig Ypserv on
#chkconfig Portmap on
#chkconfig Yppasswdd on
#chkconfig YPXFRD on
5, because the following needs more than one user, we first create, this operation is only performed on the master server:
#useradd-G Group-u uid-d Custom Directory Nistest1
#useradd Nistest2
#passwd Nistest1
#passwd Nistest2