############################################################
# 載入綱要檔
############################################################
include     /etc/openldap/schema/corba.schema
include     /etc/openldap/schema/core.schema
include     /etc/openldap/schema/cosine.schema
include     /etc/openldap/schema/duaconf.schema
include     /etc/openldap/schema/dyngroup.schema
include     /etc/openldap/schema/inetorgperson.schema
include     /etc/openldap/schema/java.schema
include     /etc/openldap/schema/misc.schema
include     /etc/openldap/schema/nis.schema
include     /etc/openldap/schema/openldap.schema
include     /etc/openldap/schema/ppolicy.schema
include     /etc/openldap/schema/collective.schema

############################################################
# 是否允許使用 LDAPv2 連線,非必要
############################################################
#allow bind_v2
     
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral       ldap://root.openldap.org

pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

############################################################
# 設定記錄檔參數
############################################################
loglevel 256
logfile /var/log/openldap/ldap.log


############################################################
# 載入動態模組,非必要
############################################################
# modulepath /usr/lib/openldap
# modulepath /usr/lib64/openldap

# moduleload accesslog.la
# moduleload auditlog.la
# moduleload back_sql.la
# moduleload chain.la
# moduleload collect.la
# moduleload constraint.la
# moduleload dds.la
# moduleload deref.la
# moduleload dyngroup.la
# moduleload dynlist.la
# moduleload memberof.la
# moduleload pbind.la
# moduleload pcache.la
# moduleload ppolicy.la
# moduleload refint.la
# moduleload retcode.la
# moduleload rwm.la
# moduleload seqmod.la
# moduleload smbk5pwd.la
# moduleload sssvlv.la
# moduleload syncprov.la
# moduleload translucent.la
# moduleload unique.la
# moduleload valsort.la


############################################################
# 使用 TLS 加密傳輸方式
############################################################
TLSCACertificatePath /etc/openldap/certs
TLSCertificateFile "\"OpenLDAP Server\""
TLSCertificateKeyFile /etc/openldap/certs/password

############################################################
# 存取權限設定
############################################################
# Sample access control policy:
#       Root DSE: allow anyone to read it
#       Subschema (sub)entry DSE: allow anyone to read it
#       Other DSEs:
#               Allow self write access
#               Allow authenticated users read access
#               Allow anonymous users to authenticate
#       Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
#       by self write
#       by users read
#       by anonymous auth
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn.  (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!

# enable on-the-fly configuration (cn=config)
############################################################
database config //資料庫設定 cn=peercred,cn=external,cn=auth
access to *
       by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage
       by * none
 
database monitor //資料庫狀態監控 cn=monitor
access to *
       by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read
       by dn.exact="cn=manager,dc=homecity,dc=idv,dc=tw" read
       by * none
 
access to attrs=userPassword //設定使用者密碼
       by self write         //僅能修改自己的密碼
       by anonymous auth     //匿名使用者需要認證
       by dn.base="cn=manager,dc=homecity,dc=idv,dc=tw" write
       by * none            
 
access to *                  //使用者資訊
       by self write         //能修改自己的資訊    
       by users read         //其他人僅能讀
       by anonymous auth     //匿名使用者需要認證
       by dn.base="cn=manager,dc=homecity,dc=idv,dc=tw" write
       by * none            
 
#######################################################################

# 資料庫定義
#######################################################################

database     bdb                                //資料庫類型
suffix       "dc=homecity,dc=idv,dc=tw"         //根節點

checkpoint   1024 15
rootdn       "cn=manager,dc=homecity,dc=idv,dc=tw//管理者帳號

rootpw       {MD5}veQexttaNuxbJTye82sbvQ==      //管理者密碼
directory       /var/lib/ldap                   //資料庫路徑
 
#######################################################################

# 索引設定

#######################################################################
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub

#######################################################################

# 主從 LDAP 伺服器同步設定

#######################################################################
# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
#     bindmethod=sasl saslmech=GSSAPI
#     authcId=host/ldap-master.example.com@EXAMPLE.COM

 

arrow
arrow

    SparkTsai 發表在 痞客邦 留言(0) 人氣()