安装NIS服务器软件包
设置time和time-udp服务的启动状态
建立服务器中的NIS域名
设置ypserv服务的配置文件
启动NIS服务器
构建数据库
安装NIS客户端软件包
设置/etc/hosts文件中的NIS服务器主机记录
建立NIS的域名
设置yp.conf配置文件 客户端配置文件
设置nsswitch.conf文件 用户登录配置文件
启动ypbind服务程序
使用NIS客户机测试与NIS服务器的连接
NIS客户端用户登录
服务器配置
1.安装与启动必要服务
rpm -ivh ypserv-xxx.rpm
chkconfig time on
chkconfig time-udp on
service xinetd restart
2.建立与加入域名
主机名部分
hostname ypserv
vi /etc/sysconfig/network
HOSTNAME=ypserv
vi /etc/hosts
域部分
nisdomainname nistest
echo '/bin/nisdomain nistest' >> /etc/rc.d/rc.local
echo 'NISDOMAIN=nistest' >> /etc/sysconfig/network
3.修改ypserv.conf配置文件
NIS服务器的主要配置文件时ypserv.conf
配置文件中可设置对认证数据库的访问控制
vi /etc/ypserv.conf
注释两行允许所有程序访问的 最后添加两行
192.168.63.0/255.255.255.0 :* :* :none
127.0.0.0/255.255.255.0 :* :* :none
* :* :* :deny
4.建立securenets安全配置文件
securenets文件用于对NIS客户端主机进行访问控制
securenets文件需要手工建立
vi /var/yp/securenets
host 127.0.0.1
255.255.255.0 192.168.63.0
5.启动NIS服务器
NIS服务器需要portmap服务的支持,并且需要启动ypserv和yppasswdd两个服务
service portmap status 这个默认启动了
service ypserv start
service yppasswdd start
