標籤:des io ar os 使用 sp for 檔案 資料
preface:ldap 主要概念及術語
OpenNebula issues:
missing step to use LDAP as default driver
cp -r /var/lib/one/remotes/auth/ldap /var/lib/one/remotes/auth/default
Standalone LDAP Daemon, slapd(standalone lightweight access protocol)
Lightweight Directory Access Protocol
LDAP目錄中資訊 按樹型結構組織
具體資訊儲存在條目(entry)的資料結構中;
條目相當於關係型資料庫中的table recored
條目具有區別名DN(distinguished name)的屬性(attribute)
DN條目的區別名是用來引用條目entry
dn (distinguished name)
dn相當於關係型資料庫中的關鍵字primary key
entry 類似於關係型資料庫表的一條記錄
dn(distinguished name) 用來引用entry 相當於關係型資料庫的關鍵字primary key
dn attributed 由類型(type) 和 一個或多個values組成,相當於關係型資料庫中的欄位(field)名和資料類型
retrieve
LDAP中的type可以有多個value 而不是關係型資料庫中為降低資料的冗餘性要求實現的各個域必須是不相關的
LDAP entry組織一般按地理位置和組織關係進行組織,很直觀
LDAP把資料存放在文字檔中,為了提高效率可以使用基於索引的檔案資料庫而不是關係型資料庫
LDAP資訊 以 樹形結構儲存
在樹根一般定義國家country(c=CN)或網域名稱(dc=com)domainName
在其下往往定義一個或多個組織(organization)(o=Acme)
組織(organization) 組織單元(organization unit)
一個組織單元可能包含諸如所有僱員.....
LDAP支援對條目能夠和必須支援哪些屬性進行控制,這是有一個特殊的稱為物件類別(ObjectClass)的屬性來實現
屬性的值決定了該條目能夠及至少應該包含哪些屬性
inetorgPerson對象類需要支援sn(surname)和cn(common name)屬性
ldap root一般定義國家 網域名稱
o --> organization (組織,公司)
ou --> organization unit(組織單元,部門)
c --> countryName(國家)
dc --> domainComponent(網域名稱)
sn --> suer name(真實名稱)
cn --> common name (常用名稱)
ldap 以樹形結構組織資訊
資訊儲存在條目中entry (可以看他是關係型資料庫中的table)
entry 有個dn(distinguished name)區別名(類似關係型資料庫中的 記錄)
dn 有屬性type及value
dn(distinguished name):o=organization,c= (country)
RDN(relative distinguished name)
dn:ou(organization unit公司-部門)=manager,o(organization 公司)=,c=country(國家)
分層hierarchy結構structure
acme
manager organization unit
employees organization
某個國家的某公司的管理組織和僱員組織dn組成
dn:cn(common name)=ruiy,ou(organization unit)=managers,o(organization)=公司名稱,c(country)=國家
設計定義ldap 目錄結構
匯入目錄資訊資料
ldap的目錄資訊資料一般儲存在ldif(lightwight directory info)檔案中
ldif(ldap data interchange format)
添加任何組織單元(organization unit)以前,dn(distinguished name)
dn(distinguished name條目,ldap的一條資訊記錄 entry recored):o(organization(comparyName)=),c(countryName)
objectClass:organization
ldap 使用rsyslog 記錄日誌
/etc/openldap/slapd.conf
添加語句
loglevel 259
/etc/rsyslog.conf
添加語句
local4.* /var/log/ldap.log
1,ldap伺服器搭建
2,ldap伺服器及本年使用
報錯解決
原因dn中無ldif中定義的OU(Organization unit類似於一個公司名稱)
解決方案添加ou
list all ldap dn object
添加ou語句
3,net-ldap add for openldap extend auth Module ldap addon外掛程式安裝(位於你的One伺服器上,安裝這個外掛程式 ldapbind)
4,ldap authentication for openNebula整合配置
5,openldap常用動作陳述式
ldapadd -x -D cn=admin,dc=ldap,dc=zzbank,dc=cc -W -f ce.ldif (添加使用者及組)
ldapsearch -x -LLL -H ldap:/// -b dc=ruige,dc=zzbank,dc=cc (搜尋 all object)
ldapdelete -x -W -D ‘cn=admin,dc=ruige,dc=zzbank,dc=cc‘ "uid=ruiy,ou=people,dc=ruige,dc=zzbank,dc=cc"(刪除使用者及組)
Tel,
net-ldap for ruby openldap ldap