说明:
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
小结:
。