一. 配置YUM軟件倉庫到CD-ROM(略)
二. 配置NIS服務器端數據庫
[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
[root@localhost ~]# cd /var/yp [root@localhost yp]# make
[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客戶端vim
[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客戶端很好用dom