全部博文(1144)
分类: LINUX
2006-05-27 11:48:35
|
一。 Server config 1. Need open LAN DNS , DHCP , NFS , PORTMAP , YPSERV AND YPPASSWDD server 2. Add users # mkdir /export/home/ -p # useradd -d /export/home/gohw -g users gohw 3. Config yp.conf and nsswitch.conf # vi /etc/yp.conf domain weblendar.com server manchester # vi /etc/nsswitch.conf passwd: files nis shadow: files nis group: files nis bootparams: files nis automount: files nis aliases: files nis 4. Config YP Makefile # cd /var/yp # cp -p Makefile Makefile.orig # vi Makefile all: passwd group hosts rpc services netid protocols mail auto.master a uto.home \ ###at 109 line #NOTE don't have space,only can use tab,it's incredibly. 5. Create the /etc/netgroup file # vi /etc/netgroup clients (edinburgh,,weblendar.com) (edinburgh.weblendar.com,,weblendar.com) (bristol,,weblendar.com) (bristol.weblendar.com,,weblendar.com) servers (manchester,,weblendar.com) (manchester.weblendar.com,,weblendar.com) nodes servers clients ###NOTE in clietns and server line,mustn't have "ENTER". ###If you config this ,your NFS will be limited,you must add machine in this file,you can use NFS. 6. Config autofs server for client (auto.master and auto.home) # vi /etc/auto.master /export/home /etc/auto.home --timeout=300 # vi /etc/auto.home jiangt manchester:/export/home/& yangb manchester:/export/home/& 7. Initialize the NIS map database # /usr/lib/yp/ypinit -m ###press '^D' when done, and confirm the information. 8. Start the server # service ypserv start # service yppasswdd start # service bind start 9. Config NFS # vi /etc/exports /export/home @clients(rw,no_root_squash,sync) # service nfs start if you had already start nfs,you can use #exportfs -r # exportfs ###check nfs 10. config secure NIS binding # vi /var/yp/securenets # Always allow access for localhost 255.255.255.0 127.0.0.1 # edinburgh host 192.168.1.21 # bristol host 192.168.1.22 11. Push the changes into the NIS maps # cd /var/yp # make 12.Reboot Server # service ypserv restart # service yppasswdd restart # exportfs -r 二。 Cient config 1. Boot from NIS # authconfig option NIS donain:weblendar.com server:manchester 2. Autoconfig # service autofs stop # rm -rf /etc/auto.* # rm -rf /home /misc 3. Config nsswitch.conf passwd: nis files shadow: nis files group: nis files automount nis files netgroup nis files 4. Mkdir /export/home directory # mkdir /export/home -p # ln -s /export/home /home 5. Reboot autofs and ypbind service # service autofs restart # service ypbind restart 6.Reboot Client and you can use NIS log on. |