一. 配置YUM软件仓库到CD-ROM(略)
二. 配置NIS服务器端

  1. 安装服务
    [root@  localhost ~]# yum -y install ypserv rpcbind
    [root@  localhost ~]# ypdomainname nis.test 
    [root@  localhost ~]# echo "NISDOMAIN=nis.test" >> /etc/sysconfig/network 
    [root@  localhost ~]# vim /var/yp/securenets
    255.0.0.0       127.0.0.0
    255.255.255.0   192.168.100.0
    [root@  localhost ~]# vi /etc/hosts
    192.168.100.71 sev01.nis.test srv01
    192.168.100.72 sev02.nis.test srv02
    [root@  localhost ~]# systemctl start rpcbind ypserv ypxfrd yppasswdd 
    [root@  localhost ~]# systemctl enable rpcbind ypserv ypxfrd yppasswdd
    [root@  localhost ~]# /usr/lib64/yp/ypinit -m
    next host to add:   sev01.nis.test
    next host to add:# Ctrl + D 
    The current list of NIS servers looks like this:
    sev01.nis.test
    Is this correct? [y/n: y] y# y 
  2. 增加用户之后要在NIS数据库同步
    [root@localhost ~]# cd /var/yp 
    [root@localhost yp]# make 
  3. 配置防火墙规则
    [root@localhost ~]# vim /etc/sysconfig/network
    # 附加在最后
    YPSERV_ARGS="-p 944"
    YPXFRD_ARGS="-p 945"
    [root@localhost ~]# vim /etc/sysconfig/yppasswdd
    # 修改成
    YPPASSWDD_ARGS="--port 946"
    [root@localhost ~]# systemctl restart rpcbind ypserv ypxfrd yppasswdd
    [root@localhost ~]# firewall-cmd --add-service=rpc-bind --permanent 
    [root@localhost ~]# firewall-cmd --add-port=944/tcp --permanent 
    [root@localhost ~]# firewall-cmd --add-port=944/udp --permanent 
    [root@localhost ~]# firewall-cmd --add-port=945/tcp --permanent 
    [root@localhost ~]# firewall-cmd --add-port=945/udp --permanent 
    [root@localhost ~]# firewall-cmd --add-port=946/udp --permanent 
    [root@localhost ~]# firewall-cmd --reload 

    三. 配置NIS客户端

[root@  localhost ~]# yum -y install ypbind rpcbind
[root@  localhost ~]# ypdomainname nis.test 
[root@  localhost ~]# echo "NISDOMAIN=nis.test" >> /etc/sysconfig/network 
[root@  localhost ~]# vi /etc/hosts
10.168.10.71    srv01.nis.test  srv01
10.168.10.72    srv02.nis.test  srv02
10.168.10.73    srv03.nis.test  srv03
10.168.10.74    srv04.nis.test  srv04
10.168.10.75    srv05.nis.test  srv05
[root@  localhost ~]# authconfig \
--enablenis \
--nisdomain=nis.test \
--nisserver=srv01.nis.test \
--enablemkhomedir \
--update
[root@  localhost ~]# systemctl start rpcbind ypbind 
[root@  localhost ~]# systemctl enable rpcbind ypbind 

附注:如果启用了SELinux,就需要添加一个规则,允许mkhomedir自动创建用户主目录

又附注: Wingdows 10 的SSH客户端很好用