ไฟล์คอนฟิก openldap สำหรับ smbldap-tools

ไฟล์คอนฟิก /etc/openldap/slapd.conf สำหรับ คอนฟิก Samba เป็น Domain Controller โดยปรับปรุงเพิ่มเติมคุณสมบัติดังนี้

  • กำหนดคีย์ (index) ที่ใช้ในการค้นหาข้อมูล
  • อนุญาตให้ผู้ใช้สามารถเปลี่ยน password โดยใช้คำสั่ง smbldap-passwd ด้วยตัวเองได้ ไม่ต้องใช้ rootdn
  • ซ่อนรหัสผ่าน (password) ไม่ให้สามารถอ่านได้โดยตรง แต่ใช้ในการตรวจสอบสิทธิ (authenticate) ได้

# ------------------------
# /etc/openldap/slapd.conf
# ------------------------
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
# Samba Schema
include     /etc/openldap/schema/samba.schema
# Allow LDAPv2 client connections.  This is NOT the default.
allow bind_v2
pidfile     /var/run/openldap/slapd.pid
argsfile    /var/run/openldap/slapd.args
# Enable Monitoring
database monitor
# ldbm and/or bdb database definitions
database    bdb
suffix      "dc=test-ldap,dc=com"
rootdn      "uid=root,ou=People,dc=test-ldap,dc=com"
rootpw      {SSHA}xxx
directory   /var/lib/ldap
# Indices to maintain for this database
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 uniqueMember                      eq
# required to support pdb_getsambapwrid()
index displayName                       pres,sub,eq
index sambaSID                          eq
index sambaPrimaryGroupSID              eq
index sambaDomainName                   eq
index sambaSIDList                      eq
index sambaGroupType                    eq
index default                           sub
# users can authenticate and change their password
# hide password fields
access to attrs=userPassword,sambaNTPassword,sambaLMPassword,sambaPwdMustChange,sambaPwdLastSet
      by self write
      by anonymous auth
      by * none
access to attrs=shadowLastChange,shadowMax
      by self write
      by * read
# all others attributes are readable to everybody
access to *
      by * read
# loglevel stats stats2
# EOF.

Leave a Reply

Your email address will not be published.