linux-NIS
2008-04-27 11:38:36
°æÈ¨ÉùÃ÷£ºÔ´´×÷Æ·£¬ÔÊÐí×ªÔØ£¬×ªÔØÊ±ÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕ Ôʼ³ö´¦ ¡¢×÷ÕßÐÅÏ¢ºÍ±¾ÉùÃ÷¡£·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£http://zhaojy.blog.51cto.com/283215/73723 |
ÓÃPUTTYÈí¼þ²Ù×÷
login as: root
Sent username "root"
root@192.168.9.150's password:
Last login: Fri Apr 4 16:11:12 2008
°²×°winscp403setupintlÈí¼þ,½«ypserv-2.13-5.i386.rpmÍÐÈëµ½LINUXÖеÄ/ROOTĿ¼ÖÐ
[root@localhost ~]# cd /root ½øÈë/ROOTĿ¼
[root@localhost ~]# ls ²é¿´Èí¼þ°ü
anaconda-ks.cfg install.log ypserv-2.13-5.i386.rpm
Desktop install.log.syslog
[root@localhost ~]# rpm -ivh ypserv-2.13-5.i386.rpm °²×°Èí¼þ°ü,ºÜ¿ì,Ò»°ãÖ»Òª¼¸ÃëÖÓ
warning: ypserv-2.13-5.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing... ########################################### [100%]
1:ypserv ########################################### [100%]
[root@localhost ~]# nisdomainname nis.benet.com ÉèÖÃNISÓòÃû
[root@localhost ~]# adduser st01 н¨Óû§
[root@localhost ~]# passwd st01 ÉèÖÃÃÜÂë
Changing password for user st01.
New UNIX password:
BAD PASSWORD: it is too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#
[root@localhost ~]# vi /etc/ypserv.conf ¿ÉÒÔ²»ÐÞ¸ÄÅäÖÃÎļþ,ÎÒûÓÐÐÞ¸Ä
[root@localhost ~]# service portmap start NIS·þÎñÐèÒªPORTMAP·þÎñµÄÖ§³Ö
Starting portmap: [ OK ]
[root@localhost ~]# service ypserv start NIS·þÎñÐèÒªÆô¶¯Õâ¸ö·þÎñ
Starting YP server services: [ OK ]
[root@localhost ~]# service yppasswdd start NIS·þÎñÐèÒªÆô¶¯Õâ¸ö·þÎñ
Starting YP passwd service: [ OK ]
[root@localhost ~]# /usr/lib/yp/ypinit ¨Cm ³õʹ»¯Êý¾Ý¿â
At this point, we have to construct a list of the hosts which will run
servers. localhost.localdomain is in the list of
the names for the other hosts, one per line. When you are done with the
list, type a <control D>. °´CTRLºÍD¼ü
next host to add: localhost.localdomain
next host to add:
The current list of
localhost.localdomain
Is this correct? [y/n: y] y °´Y¼ü
We need a few minutes to build the databases...
Building /var/yp/nis.benet.com/ypservers...
Running /var/yp/Makefile...
gmake[1]: Entering directory `/var/yp/nis.benet.com'
Updating passwd.byname...
Updating passwd.byuid...
Updating group.byname...
Updating group.bygid...
Updating hosts.byname...
Updating hosts.byaddr...
Updating rpc.byname...
Updating rpc.bynumber...
Updating services.byname...
Updating services.byservicename...
Updating netid.byname...
Updating protocols.bynumber...
Updating protocols.byname...
Updating mail.aliases...
gmake[1]: Leaving directory `/var/yp/nis.benet.com'
localhost.localdomain has been set up as a
Now you can run ypinit -s localhost.localdomain on all slave server.
ÔÚ¿Í»§»úÉϵÄÅäÖÃ
[root@localhost ~]# rpm ¨Cqa |grep ypbind²é¿´¿Í»§»úÉÏÓÐÎÞ°²×°¿Í»§¶ËÈí¼þ,ÕâÀïÒѾ°²×°ÁË
ypbind-1.17.2-3 ÕâÌõÃüÁîÔËÐеÄʱ¼ä½Ï²Å,´ó¸ÅÓÐ2·ÖÖÓ
[root@localhost ~]# nisdomainname nis.benet.com ÉèÖÃÓòÃû
[root@localhost ~]#hostname nis.benet.com Ö÷»úÃûÒªºÍNISÓòÃûÒ»ÖÂ
[root@localhost ~]#setup ÓÃÕâ¸öÈí¼þÐÞ¸ÄÅäÖÃÎļþ,ÎÒ¸ÄÁËÓòÃû,·þÎñÆ÷IP
»òÖ±½ÓÐÞ¸ÄÅäÖÃÎļþÓÃÕâÌõÃüÁîvi //etc/yp.conf,ÕâÁ½ÖÖ¿ÉÒÔÈÎѡһÖÖ
[root@localhost ~]# service portmap start NIS·þÎñÐèÒªÕâ¸ö·þÎñµÄÖ§³Ö
Starting portmap: [ OK ]
[root@localhost ~]# service ypbind restart NISÒªÆô¶¯Õâ¸ö·þÎñ
Shutting down
Binding to the
[root@localhost ~]# service yppasswdd restart NISÒªÆô¶¯Õâ¸ö·þÎñ
Stopping YP passwd service: [ OK ]
Starting YP passwd service: [ OK ]
[root@localhost ~]# chkconfig --level 35 ypbind on Æô¶¯ypbindµÄ35
[root@localhost ~]# su - st01
su: warning: cannot change directory to /home/st01: No such file or directory
-bash-3.00$ÒòΪ±¾µØÃ»ÓзþÎñÆ÷ÉϵÄ/HOMEĿ¼,ËùÒÔÓÐÕâÑùµÄ·´Ó¦
ÔÚ·þÎñÆ÷ÉÏÅäÖÃÎļþ¹²Ïí
[root@localhost ~]# rpm -qa |grep nfs ²é¿´ÓÐÎÞNFSĿ¼
nfs-utils-1.0.6-65.EL4
[root@localhost ~]# chkconfig --level 35 nfs on
[root@localhost ~]# service portmap start NFSÐèÒªÏÈÆô¶¯Õâ¸ö·þÎñ
Starting portmap: [ OK ]
[root@localhost ~]# service nfs start Æô¶¯NFS·þÎñ
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@localhost ~]# vi /etc/exports д³öÒª¹²ÏíµÄÌõÄ¿
/home *(rw,sync)
~
[root@localhost ~]# exportfs ¨Crv µ¼³öĿ¼
exporting *:/home
[root@localhost ~]# showmount ¨Ce ²é¿´µ¼³öµÄĿ¼
Export list for localhost.localdomain:
/home *
[root@localhost ~]# vi /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for deta:
192.168.9.150:/home /home nfs defaults 0 0
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=SWAP-sda2 swap swap defaults 0 0
/dev/hdc /media/cdrom auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
~
~
ÆäÖеÄ192.4168.150Ϊ·þÎñÆ÷Ãû³Æ½ô¸úÔÚºóµÄ:/HOMEΪ¹²ÏíĿ¼,/HOMEΪ±¾µØ¹ÒÔØµã,NFSΪÎļþ¸ñʽ,ÆäÖеÄ0 0 ±íʾ¿ª»ú²»×ö´ÅÅ̼ì²é,Èç¹ûÊÇ0 1Ôò±íʾ¿ª»ú×ö´ÅÅ̼ì²é,
0 0 Ö»ÄÜÓÃÉÏÃæÒ»ÅŵļüÅ̸ã,²»ÄÜÓÃÓұߵÄÊý×Ö¸ã
[root@localhost ~]# service portmap start ÔÚ¿Í»§»úÉÏÆô¶¯Õâ¸ö·þÎñÖ§³ÖNFS
Starting portmap: [ OK ]
[root@localhost ~]# service nfs start Ö»ÓÐÆô¶¯NFS·þÎñ,²ÅÄܹÒÔØÄ¿Â¼
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@localhost ~]# mount /home ÕâÌõÃüÁîÒ²ºÜ¿ì,Ò»°ãÒ²Ö»ÓÐ2µ½3ÃëÖÓ
[root@localhost ~]# su - st01
[st01@nis ~]$ ÏÖÔÚÓû§µÇ¼µÄÏÔʾÊÇÕý³£µÄ
ÐÞ¸ÄÃÜÂëÔòÐèÒªTIME ºÍTIME-UDPÕâÁ½¸ö·þÎñµÄÖ§³Ö,Æô¶¯ºóÒªÖØÆôXINETD·þÎñ
CHKCONFIG TIME ON
CHKCONFIG YPSERV START
SERVICE XINETD START
VI /ETC/HOSTS ÖÐÌí¼ÓÒ»Ìõ¼Ç¼
±¾Îijö×Ô ¡°137440593¡± ²©¿Í£¬ÇëÎñ±Ø±£Áô´Ë³ö´¦http://zhaojy.blog.51cto.com/283215/73723 ±¾Îijö×Ô 51CTO.COM¼¼Êõ²©¿Í |


137440593
²©¿Íͳ¼ÆÐÅÏ¢
ÈÈÃÅÎÄÕÂ
×îÐÂÆÀÂÛ
ÓÑÇéÁ´½Ó
