學(xué)習(xí)ldap6u用戶信息及文件集中化管理_第1頁
學(xué)習(xí)ldap6u用戶信息及文件集中化管理_第2頁
學(xué)習(xí)ldap6u用戶信息及文件集中化管理_第3頁
學(xué)習(xí)ldap6u用戶信息及文件集中化管理_第4頁
學(xué)習(xí)ldap6u用戶信息及文件集中化管理_第5頁
已閱讀5頁,還剩21頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

用戶信息及文件集化管Mark&:本文遵循“署名-非商業(yè)性使用-相同方式共享2.5陸”協(xié) 第1章用戶集中化管理的益 第2章LDAP(LightweightDirectoryAccess 第3章NFS(NetworkFile 第4章AutoFS(automount 第5.1節(jié)服務(wù)器基本配 第5.2節(jié)數(shù)據(jù)庫配 第5.3節(jié)客戶端配 第5.4節(jié)配置認(rèn)證緩存 I 應(yīng)用分布地理位置分散,十分 概念和類LDAP LDAP(LightweightDirectoryAccessLDAPLightweightDirectoryAccessProtocolX.500X.500LDAP支持TCP/IPInternet是必須的。LDAPLDAP中獲取信息。LDAP中可以各種類型的數(shù)據(jù):電子郵件地址、郵件路由信息、人力資源數(shù)據(jù)、公用密匙、聯(lián)系人列表,等等。作為系統(tǒng)集成中的一個重要環(huán)節(jié),可以簡化員工在企業(yè)內(nèi)部查詢信息的步驟,甚至連主要的數(shù)據(jù)源都可以放在任何地方。服務(wù),那LDAP無疑是一個不錯的選擇。加入對LDAP的支持,因為他們根本不用考慮另一端(客戶端或服務(wù)端)是怎么樣的。LDAP允許你根據(jù)需要使用ACI(一般都稱為ACL或者控制列表)控制對數(shù)據(jù)讀進行控制。這些都是由LDAP服務(wù)器完成,非常的安全。 不能用SQL語句了。在這個樹型結(jié)構(gòu)上的每個節(jié)點,我們稱之為“條目(Entry)”, 做基準(zhǔn)DN。比如本公司的是 ,則我的基準(zhǔn)DN為"dc=example,"。在 銷售部、財務(wù)部,等等。比如我要表示本公司銷售部的經(jīng)理級人員,我們可以這樣表2LDAPLightweightDirectoryAccess ",為了可以區(qū)分每個條目,我們需我要表示本公司銷售部的經(jīng)理級人員flyer。那么我可以這樣寫"uid=flyer,ou=manager, 在 數(shù)據(jù)庫中,所有的條目都必須定義objectClass這個屬性。每個條括必有屬性(requitedattribute)和可選屬性(optionattribute)。一個條目的屬性是由它所繼承的所有ObjectClasses的屬性集合決定的,此外可以包括LDAP中規(guī)定的“操作屬性”(操作屬性是一種獨立于ObjectClass而存在的屬性,它 也不是LDAP規(guī)定的操作屬性,那么是不能直接綁定(在LDAP中,給Entry賦予屬性的過程稱為綁定)到條目上的,你必須自定義一個含有你需要的屬性的ObjectClass,而后將此類型賦給條目。ObjectClass是可以被繼承的,這使它看上去真的很像Java語言。繼承類的對象實例也必須實現(xiàn)父類規(guī)定的必有屬性(requitedattribute),同時擁有父類規(guī)定的可選屬性(optionattribute)。繼承類可以擴展父類的必有屬性和可選屬性。LDAP的另一個重要的組成部分就是Schema,Schema定義了LDAP 結(jié)構(gòu)和規(guī)則,比如一個objectclass會有哪些屬性,這些屬性又是什等等。 NFS(NetworkFileNFSserverFILESERVERSERVER共享出來的 V3(rfc1813)(V4(rfc3010)。 AutoFS(automountAutoFS提供了一種按需自動掛接和空閑超時自動卸除文件系統(tǒng)的機制。掛接點可以使用本地的或分布式自動掛接地圖。它是一個客戶端的服務(wù),當(dāng)此服務(wù)駐留內(nèi)存后,不論什么時候,當(dāng)運行automound守護進程的客戶機上的用戶試圖文件或 時,守護進程 所屬的)文件系統(tǒng)。只要有需要,這些文件系統(tǒng)就可以一直保持被掛接狀態(tài)。如果有定義時間周期,到時automound會自動卸載該文件對于不同的物理設(shè)備(硬盤、軟盤、cdrom等等)和/或操作系統(tǒng),裝點對應(yīng)一塊區(qū)域或一個文件系統(tǒng)(例如,一個硬盤分區(qū))。然后如果你想存取其它的分區(qū),只rootmount命令(除非特定的選項“user”/etc/fstab中)。作為超級用戶root,要指明安裝位置,被安裝的分區(qū),有時還包括文件系統(tǒng)和其他一些選項。默認(rèn)情況下Automount和AutoFS允許系統(tǒng)管理員配置機器能夠的所有的文件系統(tǒng),它同樣要用到mount。用戶可以用一種完全透明的方式來這些系統(tǒng),完全不必關(guān)心內(nèi)核是如何#service#serviceautofs{start|stop|status|restart|reload|Start:含義很明顯,啟動進程。啟動時,autofs將在配置文件/etc/auto.master中查詢查詢NISmaps(關(guān)于這一點,這篇文章不作過多涉及)。Stop:autofsautomounts意,maps中的變化在重新啟動后將被體現(xiàn)出來。另一方面,auto.masterCondrestart:AutoFS是否已運行,Restart,如果AutoFS沒有運行,就什么也不做。/etc/auto.master是autofs的主要文件。每一行描述一個安裝點,指向包含文件系統(tǒng)描 。同時auto.master也可以由NIS提供每一行的語法如下[-mount-maExample/home這里設(shè)置了3個安裝點,/home,/misc和/mnt。為了/misc automount將會/etc/auto.misc文件,以便找到安裝選項和與文件系統(tǒng)相關(guān)的關(guān)鍵字(thekey)。最后2行包含可選項。他們在mount的manpage中有描述,而且是標(biāo)準(zhǔn)的。就象例子中最后一行所顯示的那樣,autofsautomountmaps(NIS或其他)auto.homeauto.misc都是掛接配置文件。其文件語法是ma floppy-fstype=automsdiskmsdisk-fstype=vfat 。例如:如果你已經(jīng)將/dev/sdb1掛接在了/home上,你就不能設(shè)置一臺LDAPNFS 為你的ldap[root@test[root@test~]#yuminstallopenldap-servers s-生成DB_CONFIG文件,ldap[root@test[root@test~]#cp-p/usr/share/openldap-[root@testopenldap]##ll-ddrwx2ldapldap409632616:41創(chuàng)建ldap[root@test~]#slappasswdNew[root@test~]#slappasswdNewpassword:uplookingRe-enternewpassword:再次輸入創(chuàng)建ldap服務(wù)器主配置文件,我們需要管理員與[root@test[root@test~]#cat>/etc/openldap/slapd.conf<< /etc/openldap/schema/p.schema allowbind_v2 ####Encrypting File/etc/pki/tls/certs/ca.crtTLSFileTLSKeyFile/etc/pki/tls/certs/slapd.key###DatabaseConfig###databasedatabaserootdnrootpwaccessto*bydn.exact=gidNumbermanageby*breakdatabase#allowonlyrootdntoreadthemonitoraccessto*byby*[root@testopenldap]#rm-rf[root@testopenldap]#slaptest-f/etc/openldap/slapd.conf-F/etc/openldap/slapd.d[root@testopenldap]#chown-Rldap:ldap/etc/openldap/slapd.d[root@testod-R000[root@testod-Ru+rwX1)生成ca私鑰,一定要留[root@test[root@test~]#opensslgenrsa-des3-outca.key4096GeneratingRSAprivatekey,4096bitlongmodulus eis65537EnterpassphraseforVerifying-Enterpassphrasefor生成ca[root@test[root@test~]#opensslreq-new-x509-days365-keyca.key-outEnterpassphraseforYouareabouttobeaskedtoenterinformationthatwillbeintoWhatyouareabouttoenteriswhatiscalledaDistinguishedNameoraTherearequiteafewfieldsbutyoucanleavesomeblankForsomefieldstherewillbeadefaultvalue,Ifyouenter'.',thefieldwillbeleftCountryName(2lettercode)StateorProvinceName(fullname)[]:shanghaiLocalityName(eg,city)[DefaultOrganizationName)OrganizationalUnitName(eg,section)CommonCommonName(eg,yournameoryourserver'shostname)Address[root@test[root@test~]#opensslgenrsa-des3-outslapd.key4096GeneratingRSAprivatekey,4096bitlongmodulus eis65537EnterpassphraseforVerifying-Enterpassphrasefor[root@test[root@test~]#opensslrsa-inslapd.key-outslapd.keyEnterpassphraseforslapd.key:writingRSA[root@test[root@test~]#opensslreq-new-keyslapd.key-outYouareabouttobeaskedtoenterinformationthatwillbeintoWhatyouareabouttoenteriswhatiscalledaDistinguishedNameoraTherearequiteafewfieldsbutyoucanleavesomeForForsomefieldstherewillbeadefaultIfyouenter'.',thefieldwillbeleftCountryName(2lettercode)StateorProvinceName(fullname)[]:shanghaiLocalityName(eg,city)[DefaultOrganizationName)OrganizationalUnitName(eg,section)CommonName(eg,yournameoryourserver'shostname)[]:Address[]:root@Pleaseenterthefollowing'extra'tobesentwithAchallengepasswordAnname注意一下,CommonName要和你的主機名一致。用CA簽名并產(chǎn)生公鑰[root@test[root@test~]#opensslx509-req-days365-inslapd.csr-CAca.crt-CAkeyca.key-01-outSignature/GettingCAPrivateEnterEnterpassphrasefor 使用密[root@test~]#cpca.crt/etc/pki/tls/certs/ca.crt[root@test~]#cpca.crt/etc/pki/tls/certs/ca.crt[root@test~]#cpslapd.crt catcat>bdb.ldif<<dn: objectClass:olcDatabaseConfigobjectClass:olcBdbConfigolcDatabase:{1}bdbolcDbDirectory:/var/lib/ldapolcRootPW:redhattime.hard=unlimitedsize.soft=unlimitedsize.hard=unlimitedolcDbIndex:uidolcDbIndex:olcDbIndex:cn,sn,dis olcDbIndex:uidNumber,gidNumbereqolcDbIndex:memberUideqolcDbIndex:objectClasseqolcDbIndex:entryCSNolcAccess:toattrs=userPasswordbyselfwritebyanonymousauthbydn.children="ou=admins,dc=example,dc=org"writeby*noneolcAccess:to*byselfwritebydn.children="ou=admins,dc=example,dc=org"writeby*rmrm-rfchownldap.ldapchownldap./var/lib/ldap/DB_CONFIGserviceslapdldapsearchldapsearch-x-b"cn=config"-D-v=config"-wconfig-hlocalhostdn-LLL|ldapaddldapadd-x-D=config"-wconfig-fbdb.ldif-hldapsearch-x-b"cn=config"-D-v=config"-wconfig-hlocalhostdn-LLL|catcat>data1.ldif<<ENDFdn:dc=example,dc=orgobjectClass:topobjectClass:dcObjectobjectclass:organizationo:ExampleOrganizationdc:Exampledescription:LDAPobjectClass:organizationalUnitou:objectClass:organizationalUnitou:dn:ou=Admins,dc=example,dc=orgobjectClass:organizationalUnitou:uid:student1cn:student1sn:1objectClass:topobjectClass:posixAccountobjectClass:inetOrgloginS:/bin/bashhomeDirectory:/ldaphome/student1mail:student1@gecos:Student1uid:student2cn:sn:2objectClass:topobjectClass:objectClass:inetOrgloginS:homeDirectory:/ldaphome/student2mail:student2@gecos:Student2objectClass:posixGroupobjectClass:topcn:ldapusersuserPassword:{crypt}xmemberuid:uid=student1memberuid:ldapaddldapadd-x-D"cn=Manager,dc=example,dc=org"-wredhat-hlocalhost-f [root@test~]#cat>~/ldif/autofs.ldif<<ENDF[root@test~]#cat>~/ldif/autof

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論