#data schemas
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
# you may use one of "md5" "smd5" "sha" "ssha" "crypt" or "cleartext" as password hash
# or put something like {SASL}myuser@mydomain.com in the userPassword attribute
# to use another authentication backend through sasl.
# Use crypt to hash the passwords
password-hash {crypt}
# Define SSL and TLS properties (optional)
# These are located where ever we ended up copying our certs to
TLSCertificateFile /certs/openldap/ser-crt.pem
TLSCertificateKeyFile /certs/openldap/ser-key.pem
TLSCACertificateFile /certs/openldap/CA-cert.pem
# you should set the loglevel to 256 initially, this will give you
# some good hints when debugging problems. Read man slapd.conf what the loglevel
# directive will give you
#loglevel 256
# slapd gentoo init script does'nt make pid correctly
# so we define it here too
pidfile /var/run/openldap/slapd.pid
#Access control List information
# users can authenticate and change their password
access to attrs="userPassword,sambaNTPassword,sambaLMPassword,sambaPwdLastSet,sambaPwdMustChange"
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=nssldap,ou=DSA,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by anonymous auth
by self write
by * none
# some attributes need to be readable anonymously so that 'id user' can answer correctly
access to attrs=objectClass,entry,homeDirectory,uid,uidNumber,gidNumber,memberUid
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by * read
# somme attributes can be writable by users themselves
access to attrs=description,telephoneNumber,roomNumber,homePhone,loginShell,gecos,cn,sn,givenname
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by self write
by * read
# some attributes need to be writable for samba
access to attrs=cn,sambaLMPassword,sambaNTPassword,sambaPwdLastSet,sambaLogonTime,sambaLogoffTime,sambaKickoffTime,sambaPwdCanChange,sambaPwdMustChange,sambaAcctFlags,displayName,sambaHomePath,sambaHomeDrive,sambaLogonScript,sambaProfilePath,description,sambaUserWorkstations,sambaPrimaryGroupSID,sambaDomainName,sambaMungedDial,sambaBadPasswordCount,sambaBadPasswordTime,sambaPasswordHistory,sambaLogonHours,sambaSID,sambaSIDList,sambaTrustFlags,sambaGroupType,sambaNextRid,sambaNextGroupRid,sambaNextUserRid,sambaAlgorithmicRidBase,sambaShareName,sambaOptionName,sambaBoolOption,sambaIntegerOption,sambaStringOption,sambaStringListoption,sambaPrivilegeList
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,ou=DSA,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by self read
by * none
# samba need to be able to create the samba domain account
access to dn.base="dc=mydomain,dc=org"
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,ou=DSA,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by * none
# samba need to be able to create new users account
access to dn="ou=Users,dc=mydomain,dc=org"
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,ou=DSA,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by * none
# samba need to be able to create new groups account
access to dn="ou=Groups,dc=mydomain,dc=org"
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,ou=DSA,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by * none
# samba need to be able to create new computers account
access to dn="ou=Computers,dc=mydomain,dc=org"
by dn="cn=samba,ou=DSA,dc=mydomain,dc=org" write
by dn="cn=smbldap-tools,ou=DSA,dc=mydomain,dc=org" write
by dn="uid=root,ou=People,dc=mydomain,dc=org" write
by * none
# this can be omitted but we leave it: there could be other branch
# in the directory
access to *
by self read
by * none
# for databases you can either use "bdb" or "ldbm". bdb is generally favoured by
# the openldap project as it is faster and more stable, it is somewhat difficult
# to setup when your server is under high load. Hint: create a DB_CONFIG file in
# your data directory (/var/lib/openldap-data/) and read the berkeley db documentation
# at sleepycat.com
database ldbm
directory /var/lib/openldap-data/
suffix "dc=mydomain,dc=org"
rootdn "cn=root,dc=mydomain,dc=org"
rootpw secret
#index objectClass eq
index objectClass,uid,uidNumber,gidNumber,memberUid eq
index sambaSID,sambaPrimaryGroupSID,sambaDomainName eq
index cn,sn,uid,displayName pres,sub,eq
index memberUid,mail,givenname eq,subinitial
|