nis
一.服务器端配置

1.安装服务器端软件包
mount /dev/cdrom
cd /media/cdrom/RedHat/RPMS
rpm -ivh ypserv-2.13-5.i386.rpm

2.设置time和time-udp服务
chkconfig time on
chkconfig time-udp on
service xinetd restart

3.建立nis域名
nisdomainname zt

vi /etc/rc.d/rc.local
添加:
nisdomainname zt
vi /etc/sysconfig/network
添加:
NISDOMAIN=zt

4.设置ypserv配置文件
vi /etc/ypserv.conf
添加:
127.0.0.0/255.255.255.0 : * : * : none
192.168.1.0/255.255.255.0 : * : * : none
* : * : * : none


5.启动nis服务
service portmap start
service ypserv start
service yppasswdd start

chkconfig --level 35 ypserv on
chkconfig --level 35 yppasswdd on

6.构建nis数据库
/usr/lib/yp/ypinit -m


二.nis客户端配置管理
1.安装客户端软件包
rpm -ivh ypbind

2.设置hosts文件
vi /etc/hosts
添加:
192.168.1.1 rhel.test.com 

3.建立nis域名
nisdomainname zt

vi /etc/rc.d/rc.local
添加:
nisdomainname zt
vi /etc/sysconfig/network
添加:
NISDOMAIN=zt

4.设置ypbind配置文件
vi /etc/yp.conf
添加:
domain zt
server rhel.test.com 

5.设置nsswitch.conf
vi /etc/nsswitch.conf
添加:
passwd: nis files
shadow: nis files
group: nis files
hosts: nis files dns

6.启动ypbind服务
service portmap start
service ypbind start
chkconfig --level 35 ypbind on

三.设置图形界面登陆nis服务器
1.服务器端:
vi /etc/exports
/home 192.168.1.0/24(rw,sync)
service nfs start
2.客户端
vi /etc/fstab
192.168.1.1:/home/ /home nfs   defaults 0 0

mount /home