| 327 | |
| 328 | ''' Setting up LDAP server ''' |
| 329 | |
| 330 | Decide on the organizational structure for ldap: |
| 331 | {{{ |
| 332 | orbit-lab.org => dc=orbit-lab,dc=org |
| 333 | }}} |
| 334 | Install the server and utilities: |
| 335 | {{{ |
| 336 | apt-get install slapd ldap-utils phpldapadmin |
| 337 | }}} |
| 338 | Modify the /etc/default/slapd file and edit the SLAPD_CONF and SLAPD_PIDFILE values to |
| 339 | {{{ |
| 340 | SLAPD_CONF="/etc/ldap/slapd.conf" |
| 341 | SLAPD_PIDFILE="/var/run/slapd/slapd.pid" |
| 342 | }}} |
| 343 | This is our slapd.conf file, please change it according to your organization |
| 344 | |
| 345 | {{{ |
| 346 | allow bind_v2 |
| 347 | include /etc/ldap/schema/core.schema |
| 348 | include /etc/ldap/schema/cosine.schema |
| 349 | include /etc/ldap/schema/nis.schema |
| 350 | include /etc/ldap/schema/inetorgperson.schema |
| 351 | include /etc/ldap/schema/ldapns.schema |
| 352 | include /etc/ldap/schema/openssh-lpk_openldap.schema |
| 353 | |
| 354 | oglevel 256 |
| 355 | modulepath /usr/lib/ldap |
| 356 | moduleload back_bdb |
| 357 | |
| 358 | backend bdb |
| 359 | database bdb |
| 360 | index objectclass,entryCSN,entryUUID eq |
| 361 | suffix "dc=orbit-lab,dc=org" |
| 362 | rootdn "dc=orbit-lab,dc=org" |
| 363 | directory "/var/lib/ldap" |
| 364 | access to dn.base="" by * read |
| 365 | access to * by dn.regex="cn=admin,dc=orbit,dc=lab,dc=org" write by * read |
| 366 | access to attrs=userPassword by dn.regex="cn=admin,dc=orbit-lab,dc=org" write by anonymous auth by self write by * none |
| 367 | }}} |
| 368 | You can download openssh-lpk_openldap.schema from http://code.google.com/p/openssh-lpk/downloads/detail?name=openssh-lpk_openldap.schema |
| 369 | |
| 370 | Set sizelimit to 10000 by editing slapd.conf file |
| 371 | {{{ |
| 372 | sizelimit 10000 |
| 373 | }}} |
| 374 | Start the service: |
| 375 | {{{ |
| 376 | /etc/init.d/slapd start |
| 377 | }}} |
| 378 | |
| 379 | /etc/init.d/slapd start |
| 380 | |
| 381 | make sure you can access the service with admin credentials: |
| 382 | {{{ |
| 383 | ldapsearch -x -b "dc=orbit-lab,dc=org" "objectClass=organizationalRole" |
| 384 | ldapsearch -x -b "dc=orbit-lab,dc=org" "objectClass=organizationalUnit" |
| 385 | ldapsearch -x -b "dc=orbit-lab,dc=org" "objectclass=organizationalUnit" |
| 386 | ldapsearch -x -b "dc=orbit-lab,dc=org" "objectClass=posixGroup" |
| 387 | ldapsearch -x localhost -D "cn=admin,dc=orbit-=lab,dc=org" -W -b "dc=orbit-lab,dc=org" uid=* |
| 388 | }}} |