NIS Client
Configure for client side:
1:check ypbind、yp-tools package
[root@localhost ~]# yum install portmap ypbind yp-tools
[root@localhost ~]# rpm -qa | grep ^yp
ypbind-1.19-11.el5
yp-tools-2.9-0.1
[root@localhost ~]# rpm -qa | grep portmap
portmap-4.0-65.2.2.1
2.create NIS domain name
[root@localhost ~]# nisdomainname linuxcream
[root@localhost ~]# echo “/bin/nisdomainname linuxcream” >> /etc/rc.d/rc.local
[root@localhost ~]# echo “NISDOMAIN=linuxcream” >> /etc/sysconfig/network
3.set /etc/hosts and /etc/netgroup
[root@linuxcream /]#vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
100.0.0.1 master.linuxcream
100.0.0.2 slave.linuxcream
100.0.0.3 client.linuxcream
[root@crazylinux /]# touch /etc/netgroup
4.configure nsswitch.conf
[root@linuxcream /]# vi /etc/nsswitch.conf
passwd: files nis nisplus
shadow: files nis nisplus
group: files nis nisplus
hosts: files nis dns
5.set /etc/sysconfig/authconfig
[root@linuxcream /]# vi /etc/sysconfig/authconfig
USENIS=no–>yes
6.set /etc/yp.conf
[root@localhost ~]# cat /etc/yp.conf
domain linuxcream server master.linuxcream /* line 4
domain linuxcream server slave.linuxcream
7.start ypbind
[root@localhost ~]# service portmap status
portmap (pid 1683) is running…
[root@localhost ~]# service ypbind start
Binding to the NIS domain: [ OK ]
Listening for an NIS domain server..
set nis server
[root@localhost ~]# vi /etc/exports
/home 100.0.0.0/8(rw,async,np_root_squash)
[root@localhost ~]#service nfs start
set nis client
[root@localhost ~]#vi /etc/fstab
master.linuxcream:/home/ /home nfs defaults 0 0
testing……