NIS服务器搭建

一、NIS服务器端

1、NIS服务器软件包安装;

(挂载第1张光盘)#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 nistest

#echo '/bin/nisdomainname nistest' >> /etc/rc.d/rc.local      设置开机自启动

#echo 'NISDOMAIN=nistest' >> /etc/sysconfig/network        设置开机网卡检测

4、设置ypserv服务的配置文件;

#vi /etc/ypserv.conf

127.0.0.1/255.255.255.255    : *         :*          :none

192.168.10.0/255.255.255.0   : *         : *          :none

*                            :*         :*          :deny

5、启动配置服务;

#service ypserv restart

#service portmap restart

#service yppasswdd restart

#chkconfig --level 35 ypserv on

#chkconfig --level 35 yppasswdd on

6、构建NIS数据库;

#/usr/lib/yp/ypinit -m

二、NIS客户机端

1、需要的软件包(系统默认安装的)

ypbind-1.17.2-3

yp-tools-2.8-7

2、设置hosts文件

#echo '192.168.10.10 nisserver' >> /etc/hosts

3、建立NIS域名

#nisdomainname nistest

#echo '/bin/nisdomainname nistest' >> /etc/rc.d/rc.local

#echo 'NISDOMAIN=nistest' >> /etc/sysconfig/network

#echo 'domain nistest server nisserver' >> /etc/yp.conf

4、设置nsswitch.conf文件

passwd:     files nis

shadow:    files nis

group:     files nis

hosts:     files nis dns

5、启动ypbind服务

#service portmap status  #需保证portmap服务正在运行

#service ypbind start

#chkconfig --level 35 ypbind on

 

 

配置完成后,可用ypcat、ypwhich、yptest来测试;

用法:

①yptest

②ypcat -x、ypwhich -x

③ypcat group、ypcat hosts

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值