Use new style syntax for unique overlay
[mirror/userdir-ldap.git] / doc / slapd-config.txt
1 Most of the configuration of the ldap server has to do with getting correct
2 access controls to keep the data safe. Here is a sample:
3
4 # Turn on automatic last modification time 
5 lastmod on
6
7 # Index some things
8 index uid eq
9 index keyfingerprint eq
10 index cn,sn approx,sub,eq
11
12 # Administrate 
13 #rootdn "uid=admin,ou=users,dc=debian,dc=org"
14 #rootpw
15
16 # Restrict reading/modification of the password to administration and self
17 access to attrs=userpassword,sshrsaauthkey
18         by self write
19         by dn="uid=admin,ou=users,dc=debian,dc=org" write
20         by group="uid=admin,ou=users,dc=debian,dc=org" write
21         by * compare    
22
23 access to attrs=emailforward
24         by dn="uid=admin,ou=users,dc=debian,dc=org" write
25         by group="uid=admin,ou=users,dc=debian,dc=org" write
26         by self write
27         by addr=127.0.0.1 read
28         by domain=.*\.debian\.org read
29         by * none
30 access to attrs=c,l,loginShell,ircNick
31         by dn="uid=admin,ou=users,dc=debian,dc=org" write
32         by group="uid=admin,ou=users,dc=debian,dc=org" write
33         by self write
34 access to attrs=facsimileTelephoneNumber,telephoneNumber,postalAddress,postalC
35 ode,loginShell,onvacation,privateSub,latitude,longitude
36         by dn="uid=admin,ou=users,dc=debian,dc=org" write
37         by group="uid=admin,ou=users,dc=debian,dc=org" write
38         by self write
39         by dn="uid=.*,ou=users,dc=debian,dc=org" read
40         by * none
41 access to * 
42         by dn="uid=admin,ou=users,dc=debian,dc=org" write
43         by group="uid=admin,ou=users,dc=debian,dc=org" write
44
45 # Overlays are useful to enforce constraints:
46
47 moduleload /usr/lib/ldap/unique.so
48 overlay unique
49 unique_uri ldap:///ou=users,dc=debian,dc=org?uidNumber,uid,keyFingerPrint?sub
50 unique_uri ldap:///ou=groups,dc=debian,dc=org?gidNumber,cn?sub
51
52 # End----------
53
54 Note that in more modern versions of slapd, the "by addr" and "by domain"
55 syntax has changed and the following should be used instead:
56         by peername.ip=127.0.0.1 read
57         by domain.subtree=debian.org read
58
59
60
61 Here is the initial seed file to import and setup the proper entries:
62
63 dn: dc=org
64 dc: net
65 objectClass: top
66 objectClass: domain
67
68 dn: dc=debian,dc=org
69 dc: visi
70 objectClass: top
71 objectClass: domain
72
73 dn: ou=users,dc=debian,dc=org
74 ou: users
75 objectClass: top
76 objectClass: organizationalUnit
77
78 dn: uid=admin,ou=users,dc=debian,dc=org
79 uid: admin
80 cn: LDAP administrator
81 objectClass: top
82 objectClass: groupOfNames
83 userPassword: {crypt}?????
84 member: uid=jgg,ou=users,dc=debian,dc=org
85 member: uid=joey,ou=users,dc=debian,dc=org
86 member: uid=troup,ou=users,dc=debian,dc=org
87 mail: debian-admin@debian.org