SQLApGڦQ Linux DAoQDȭtdP\AƹWAҦDbPKXۦPIڬONbPKXO]wmbQqWA٬OiHzL@Dbz\AMLDunΤεnJɡANnzbDWT{bPKXOH@ӤKӥBFHMO@ӱbzDKhաIpGϥΪ̭nקKXAnhQDקKXաIunDnzDhקALDڥNݭnʡIIPSr֩OIoӥ\Fܦh觋Abo̡Aڭ̤Ф@ӫ²檺觋ANO Network Information Service o NIS A[]աI |
[root@test
root]# /etc/rc.d/init.d/portmap start
[root@test root]# netstat -tl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:sunrpc *:* LISTEN # pGݨ sunrpc ܡANܱҰʦ\FI [root@test root]# chkconfig --level 35 portmap on # Wo@b]w portmap b run-level 3, 5 ɭԴN}ɱҰʡI |
[root@test
root]# vi /etc/xinetd.d/time
# 쩳Uo@G disable = yes # NL令 disable = no # xs} [root@test root]# vi /etc/xinetd.d/time-udp # P˪N disable = yes 令 disable = no YiI @ [root@test root]# /etc/rc.d/init.d/xinetd restart [root@test root]# netstat -utl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:time *:* LISTEN tcp 0 0 *:sunrpc *:* LISTEN udp 0 0 *:time *:* udp 0 0 *:sunrpc *:* |
1. إ NIS
W (ڳo̬O]w cluster )G
[root@test root]# nisdomainname cluster [root@test root]# vi /etc/rc.d/rc.local # NUo@[Joɮת̫@椺G /bin/nisdomainname cluster @ 2. ]wnѼơG [root@test root]# vi /etc/sysconfig/network # [JUo@G NISDOMAIN=cluster |
<]w>:<]wت> |
[root@test
root]# vi /etc/ypserv.conf
files: 30 # oOyhָƮwɮ(database file)|QŪi֨Oz # NA@ӻA 30 OwgܨƭȤFAݭnʥLF @ trusted_master: your.master.servers.name xfr_check_port: yes # WoӳȻP Master + Slave [c]wȡA@ӻA # u@Dn NIS Server tΤOΤoӳ]wȪI # pGA NIS O slave [cAݭnw@ master Ʈwe # PBɭԪDANO trusted_master ]weoI # pGS master/slave [cɡANݭn trusted_master oӳ]wFI # ܩ xfr_check_port hOw master P slave O_nH < 1024 # HU port Ӷi淾qTIq`w]NO yes AݭnʥLI @ # <DW/IP>:<W>:<ƮwO>:<w> # oӬOoɮ̭̭nFIDnb]wwʪ譱A # iH]whAӬO_qLWhOy@@ˬdz觋I # ҥHo̪]wӬOG}n}AMI # ͤ@ͦUӬءG # 1. DW/IPGo̥iHo˳]wG192.168.1.0/255.255.255.0 # 2. WGq`]w * YiI # 3. ƮwOGiHϥ * ӪܩҦƮwI # 4. wGDnTذѼơG #@@@@@@none GLצpNOiHLiJF #@@@@@@port GȤ\ < 1024 HU port iJF #@@@@@@deny GLצpNOHanJDI # ѩڬO\ 127.0.0.0/255.0.0.0 H 192.168.10.0/255.255.255.0 iJA # LIҥHڥiHo˳]wG 127.0.0.0/255.255.255.0 : * : * : none 192.168.10.0/255.255.255.0: * : * : none * : * : * : deny # O] /etc/shadow ̭ɮ`nHݨaIӤSѩ Linux # tηAu root iHҥ < 1024 HU port A]Aw]wA iHo˰G 127.0.0.0/255.255.255.0 : * : * : port 192.168.10.0/255.255.255.0: * : * : port * : * : * : deny # T]NFI # LצpApGzQnz NIS Server B@ֳtAåBwʤW # SӦhҶq(ɡI)Aϥ none O@ӤDNI |
<host>,<user>,<domain>
D,ϥΪ̱b,W |
[root@test root]# touch /etc/netgroup |
1. ҰoI
[root@test root]# /etc/rc.d/init.d/ypserv start [root@test root]# /etc/rc.d/init.d/yppasswdd start @ 2. [@UO_uʧ@H [root@test root]# rpcinfo -u localhost ypserv program 100004 version 1 ready and waiting program 100004 version 2 ready and waiting [root @test root]# rpcinfo -u localhost yppasswdd program 100009 version 1 ready and waiting # o rpcinfo NOb[P RPC Server program ثepI # ]iHΥL[A ypserv I @ 3. ]w}ɱҰʡG # AiHϥ ntsysv Ao̧ڭ̨ϥ chkconfig oI [root@test root]# chkconfig --level 35 ypserv on [root@test root]# chkconfig --level 35 yppasswdd on |
1. s@ƮwG
[root@test root]# /usr/lib/yp/ypinit -m At this point, we have to construct a list of the hosts which will run NIS servers. server.cluster is in the list of NIS server hosts. Please continue to add the names for the other hosts, one per line. When you are done with the list, type a <control D>. next host to add: server.cluster next host to add: <==bo̫U[ctrl + d]X The current list of NIS servers looks like this: server.cluster Is this correct?
[y/n: y] y
# oӰʧ@OCקϥΪ̸ƫ@wnʧ@IANOss@ƮwA
|
[root@client
root]# /etc/rc.d/init.d/portmap start
[root@client root]# netstat -tl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:sunrpc *:* LISTEN pGݨ sunrpc ܡANܱҰʦ\FI [root@test root]# chkconfig --level 35 portmap on Wo@b]w portmap b run-level 3, 5 ɭԴN}ɱҰʡI |
[root@client
root]# vi /etc/hosts
# nUo@I 192.168.10.30 server.cluster |
1. إ NIS
domain nameG
[root@client root]# nisdomainname cluster [root@client root]# vi /etc/rc.d/rc.local # [JUo@G /bin/nisdomainname cluster [root@client root]# vi /etc/sysconfig/network # [JUo@G NISDOMAIN=cluster @ 2. إ NIS dMDW [root@client root]# vi /etc/yp.conf # [JoG domain cluster ypserver server.cluster # ٬OnOoA cluster OA NIS domain Aܩ server.cluster # hO NIS Server DW١Aڳo̬OϥΤp IP AҥHW٥iHHK # ڳwӿܪI |
1. KXɪקG
[root@client root]# vi /etc/passwd # ٰOooɮܡHoɮ`@CAӨC쳣Hy:zj}A # TаѦҰ¦Dz߽g̭bz`Cѩڭ̭nN # ]wH NIS Server ƮwҡA]A # boɮת̫᭱[Jo@G +:::::: # `NIb + s[ӡy : zAåBSťզrI @ 2. dMKX{ǡG # ]ڭ̦ܦh觋ӬdMKXAݭnק /etc/nsswitch.conf oɮפ~ [root@client root]# vi /etc/nsswitch.conf # ѼơAç令UoˡG passwd: files nis nisplus shadow: files nis nisplus group: files nis nisplus hosts: files nis dns # oɮצb]w@ǸTdM{ǡI files OɮסA # ܩ nis hOzL NIS ӶidMAܩ nisplus hO NIS+ oOs # NIS աILAxWAثeoӵoipewgȰFI # 1. passwd: NOϥΪ̬TdMAO /etc/passwd, nis P nisplus # 2. shadow: NOϥΪ̱KXdMA /etc/shadow, nis nisplus # 3. group: NOϥΪ̪sոTdMA /etc/group, nis nisplus # 4. hosts: NODWٻPIPdMA/etc/hosts, nis /etc/resolv.conf |
1. ʱҰ
ypbind aG
[root@client root]# /etc/rc.d/init.d/ypbind start [root@client root]# rpcinfo -p localhost program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100007 2 udp 735 ypbind 100007 1 udp 735 ypbind 100007 2 tcp 738 ypbind 100007 1 tcp 738 ypbind # ܤ֭nWXӸT~O諸ILAݭnOoOA port number # OtHҰʪAҥH port number C|Ӥ@˰ڡI # Oong` rpcinfo hˬd@U RPC Server AȤ~I @ 2. ]w}ɱҰʡG [root@client root]# chkconfig --level 35 ypbind on |
[root@client
root]# yptest
Test 1: domainname Configured domainname is "cluster" Test 2: ypbind
Test 9: yp_all
|
[root@client
root]# ypwhich
server.cluster [root@clent root]# ypwhich -x Use "ethers" for map "ethers.byname" Use "aliases" for map "mail.aliases" Use "services" for map "services.byname" Use "protocols" for map "protocols.bynumber" Use "hosts" for map "hosts.byname" Use "networks" for map "networks.byaddr" Use "group" for map "group.byname" Use "passwd" for map "passwd.byname" |
[root@client
root]# ypcat -x
Use "ethers" for map "ethers.byname" Use "aliases" for map "mail.aliases" Use "services" for map "services.byname" Use "protocols" for map "protocols.bynumber" Use "hosts" for map "hosts.byname" Use "networks" for map "networks.byaddr" Use "group" for map "group.byname" Use "passwd" for map "passwd.byname" # Dn\NOyCXƮwzoIP ypwhich -x ۦP\I # ҥHڭ̦ ethers, aliases......passwd ƮwWٻPɦWI @ [root@client root]# ypcat [ƮwW٩Υ\] # oӫOiHΨӨo NIS Server WUӸƮweI # |ҨӻAڭ̷QnD passwd ( KX ) ҦϥΪ̤eANݭnG [root@client root]# ypcat passwd ( ypcat passwd.byname ) test:dkoUW2XHV30sEV5gLM4NapyuhBcpVs.:500:500::/home/test:/bin/bash # pGOQnD hosts e (NIS Server DW /etc/hosts e)G [root@client root]# ypcat hosts 127.0.0.1 localhost localhost.localdomain 192.168.10.30 server.cluster # ϥNO[WƮwAANiHo NIS server DWƮweաI |
1. ]w NIS
Server D NFS }ؿG
[root@test root]# vi /etc/exports /home 192.168.10.0/24(rw,async,no_root_squash) @ [root@test root]# exportfs -rv exporting 192.168.10.0/24:/home @ [root@test root]# /etc/rc.d/init.d/nfs start Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS daemon: [ OK ] Starting NFS mountd: [ OK ] @ [root@test root]# chkconfig --level 35 nfs on @ 2. ]w NIS Client mount ơI # H root nJ NIS Client DWG [root@client root]# mount -t nfs 192.168.10.30:/home /home # pGSDFANNWo@[J /etc/rc.d/rc.local aI |
/sbin/iptables
-A -s 192.168.10.0/24 --dport 111 -j ACCEPT
/sbin/iptables -A --dport 111 -j DROP |
[root @test
root]# vi /etc/hosts.allow
portmap: 192.168.10.0/255.255.255.0 [root @test
root]# vi /etc/hosts.deny
|