Centos/Redhat7.9搭建NIS服务

说明:
  Centos/Redhat7.9搭建NIS服务

服务端安装ypserv、yp-tools、ypbind

yum install ypserv yp-tools -y

nisdomainname icserver.com

vim /etc/sysconfig/network
NISDOMAIN=icserver.com

vim /etc/ypserv.conf
# Host                     : Domain  : Map              : Security 
# *                        : *       : passwd.byname    : port 
# *                        : *       : passwd.byuid     : port
172.0.0.0/255.255.0.0      : *       : *     : none

systemctl start ypserv.service
systemctl status ypserv.service
systemctl enable ypserv.service

/usr/lib64/yp/ypinit -m

At this point, we have to construct a list of the hosts which will run NIS
servers.  licserver is in the list of NIS server hosts.  Please continue to add
the names for the other hosts, one per line.  When you are done with the
list, type a <control D>.
        next host to add:  licserver
        next host to add:  
The current list of NIS servers looks like this:

licserver

Is this correct?  [y/n: y]  y
We need a few minutes to build the databases...
Building /var/yp/icserver.com/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/icserver.com'
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating rpc.byname...
Updating rpc.bynumber...
Updating services.byname...
Updating services.byservicename...
Updating netid.byname...
Updating protocols.bynumber...
Updating protocols.byname...
Updating mail.aliases...
gmake[1]: Leaving directory `/var/yp/icserver.com'

licserver has been set up as a NIS master server.

Now you can run ypinit -s licserver on all slave server.

客户端配置

yum install yp-tools -y

nisdomainname icserver.com

vim /etc/sysconfig/network
NISDOMAIN=icserver.com

vim /etc/nsswitch.conf
passwd:     files nis sss
shadow:     files nis sss
group:      files nis sss
#initgroups: files sss

#hosts:     db files nisplus nis dns
hosts:      files nis dns myhostname
automount:  files nis

vim /etc/yp.conf 
domain icserver.com server 172.0.11.10

systemctl start ypbind.service
systemctl enable ypbind.service
yptest

小结:
  。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值