redhat 6上nis有点改动。在这里记一下

新装系统以后,首先要

yum install ypserv

安装ypserv的包

然后是设置

 
# 设置nis服务器名字

ypdomainname centos
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=headnode
# 最后加上一句

NISDOMAIN=centos
修改yp的Makefile
vi /var/yp/Makefile
# MERGE_PASSWD=true|false
# line 42: change

MERGE_PASSWD=
false
# MERGE_GROUP=true|false
# line 46: change

MERGE_GROUP=
false
# line 117: add

all: passwd shadow group hosts rpc services netid protocols

最后加一行

192.168.100.1/255.255.255.0 : * :* :none


修改安全设置

vi /var/yp/securenets

255.255.255.0   192.168.100.0

添加主机名

vi /etc/hosts
# add own IP address

192.168.100.1 headnode

开启nis服务

/etc/rc.d/init.d/ypserv start

/etc/rc.d/init.d/yppasswdd start

/etc/rc.d/init.d/ypxrfd start

chkconfig ypserv on

chkconfig yppasswdd on

chkconfig ypxfrd on