本次的服务端是Proxy 客户端是Client
[root@proxy ~]# yum -y install ypserv ypbind
[root@proxy ~]# vim /etc/sysconfig/network
NISDOMAIN=hpc
[root@proxy ~]# systemctl restart ypserv
[root@proxy ~]# systemctl restart yppasswdd
[root@proxy ~]# cd /var/yp /
[root@proxy yp]# make
[root@proxy ~]# vim /etc/yp.conf
domain hpc server 192.168.4.5 ###### 服务端地址
[root@proxy ~]# vim /etc/nsswitch.conf +33 ##### 直接到配置文件的第33行
passwd: files nis sss
shadow: files nis sss
group: files nis sss
[root@proxy ~]# systemctl restart ypbind
[root@proxy~]scp /etc/yp.conf /etc/nsswitch.conf 192.168.4.100:/etc/sysconfig/ [root@client ~]# yum -y install ypbind.x86_64 [root@client ~]# systemctl restart ypbind [root@client ~]# ypcat passwd #####看服务端的用户 [root@client ~]# ssh test@192.168.4.5 ###测试