NIS

#  04/01/09 wrote by DYWER
*SERVER*
install
 [root@server ~]#rpm -ivh ypserv-1.19-8.el5.rpm
 [root@clinet ~]#rpm -ivh yp-tools-2.9-0.1.rpm # yppaasswdd service
 vim /etc/sysconfig/network
 NISDOMAIN=vmnis
 HOSTNAME=server
mount
 [root@server ~]#echo '/home 172.16.1.101(rw,sync,root_squash)' >> /etc/exports
 [root@server ~]#chkconfig nfs on && service nfs restart 
 [root@server ~]#showmount -e localhost
 [root@server ~]#chkconfig autofs off && service autofs stop
 [root@server ~]#echo '/home   yp:auto.home' >> /etc/auto.master
 [root@server ~]#echo '*  -rw,soft,intr   172.16.1.1:/home/&' > /etc/auto.home 
conifgure
 vim /etc/ypserv.conf
 172.15.1.101 : * : * : none
 *  : * : * : deny
 [root@server ~]#/usr/lib/yp/ypinit -m 
 [root@server ~]#vim /var/yp/Makefile  # find "all:"add 'auto.master auto.home'
 [root@server ~]#cd /var/yp/ && make
service
 chkconfig ypserv on && chkconfig yppasswdd on && chkconfig portmap on
 service ypserv restart && service yppasswdd restart && service portmap start

*CLINET* 
 # as well, you can use setup tool to configure NIS! 
 [root@clinet ~]#vim /etc/nsswitch     # automount nis files
service
 chkconfig portmap on && chkconfig ypbind on && chkconfig autofs on
 service portmap restart && service ypbind restart && service autofs restart
TEST
 server: add user, touch files, cd /var/yp && make
 client: login as newuser, yptest, ypwhich
  yppasswd newuser,enter root password on nis server
 # ypwhich  单纯使用 ypwhich 的时候显示的是『NIS Client 的 domain』名称
 # ypwhich -x  加入 -x 这个参数时则是显示『NIS Client 与 Server 之间沟通的数据库有哪些?』
 # ypcat -x  主要的功能就是『列出数据库』��!与 ypwhich -x 相同功能

SAFE
#  实现自动挂载后,确保/home不开放给非NIS客户端! 不然随便哪台linux mount上,就可以随便改了
 #------ypserv.conf------------------------------------------------------------
       host   IP address. Wildcards are allowed.
              131.234. = 131.234.0.0/255.255.0.0
              131.234.214.0/255.255.254.0
       domain specifies the domain, for which this rule should be applied. An  asterix  as
              wildcard is allowed.
       map    name of the map, or asterisk for all maps.
       security
              one of none, port, deny:
       none   always allow access.
       port   allow access if from port < 1024. Otherwise do not allow access.
       deny   deny access to this map.
 #------------------------------------------------------------------------------

你可能感兴趣的:(职场,休闲,NIS)