Understanding LDAP: Protocols, Operations, and Backends

kaist 12 sparcs 12 n.w
1 / 47
Embed
Share

Explore LDAP (Lightweight Directory Access Protocol), its protocols like DAP and DISP, operational bindings, backend types, common usage scenarios, LDIF format, and more in this comprehensive guide.

  • LDAP
  • Protocols
  • Operations
  • Backends
  • LDIF

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. KAIST 12 / SPARCS 12 chaos

  2. ex) ID People Name Phone number

  3. The software system that stores, organizes and provides access to information in a directory

  4. .

  5. DAP(Directory Access Protocol) DSP(Directory System Protocol) DISP(Directory Information Shadowing Protocol) DOP(Directory Operational Bindings Management Protocol)

  6. Lightweight Directory Access Protocol TCP/IP . Lightweight Directory Access Protocol

  7. Directory Information Tree

  8. Available backend types Data Storage backends bdb : built on BerkeleyDB ldif : built on plain text LDIF files Proxy backends ldap : simple proxy to other LDAP servers passwd : uses a passwd and group data Dynamic backends shell : invokes shell scripts for LDAP requests config: slapd configuration via LDAP

  9. Common usage of LDAP Centralization of user and group information Authenticate users locally Authenticate users in a web application Create a shared address directory for mail agents

  10. LDIF(LDAP Data Interchange Format) dn: uid=chaos,ou=People,dc=sparcs,dc=org uid: chaos cn: chaos objectClass: account objectClass: posixAccount objectClass: top objectClass: shadowAccount shadowMax: 99999 shadowWarning: 7 loginShell: /bin/bash uidNumber: 4304 homeDirectory: /home/chaos gecos: ,,, gidNumber: 200

  11. LDIF dn: cn=chaos,ou=People,dc=sparcs,dc=org changetype: modify replace: cn cn: rodumani <DN of the entry> changetype: [modify | add | delete] (if changetype is modify)[replace | add | delete]: <attribute>

  12. Schema LDAP schema objectClass . LDAP schema Linux schema .

  13. # apt-get install slapd ldap-utils slapd : stand-alone LDAP daemon

  14. # ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif # ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif # ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif

  15. slappasswd root@i-10-1-3-10:~# slappasswd New password: Re-enter new password: {SSHA}otkHcuPvZDGTKFt0EVZV4gNgzSboNY+S

  16. backend.sparcs.org.ldif # Load dynamic backend modules dn: cn=module,cn=config objectClass: olcModuleList cn: module olcModulepath: /usr/lib/ldap olcModuleload: back_hdb # Database settings dn: olcDatabase=hdb,cn=config objectClass: olcDatabaseConfig objectClass: olcHdbConfig olcDatabase: {1}hdb olcSuffix: dc=sparcs,dc=org olcDbDirectory: /var/lib/ldap olcRootDN: cn=admin,dc=sparcs,dc=org

  17. olcRootPW: {SSHA}otkHcuPvZDGTKFt0EVZV4gNgzSboNY+S olcDbConfig: set_cachesize 0 2097152 0 olcDbConfig: set_lk_max_objects 1500 olcDbConfig: set_lk_max_locks 1500 olcDbConfig: set_lk_max_lockers 1500 olcDbIndex: objectClass eq olcLastMod: TRUE olcDbCheckpoint: 512 30 olcAccess: to attrs=userPassword by dn="cn=admin,dc=sparcs,dc=org" write by anonymous auth by self write by * none olcAccess: to attrs=shadowLastChange by self write by * read olcAccess: to dn.base="" by * read olcAccess: to * by dn="cn=admin,dc=sparcs,dc=org" write by * read

  18. # ldapadd -Y EXTERNAL -H ldapi:/// -f backend.sparcs.org.ldif

  19. ACL(Access Control List)

  20. ACL(Access Control List) olcAccess: to <Entry> | <Attribute> by <DN><PERM> [by <DN><PERM> ] olcAccess: to * by self write by anonymous auth by * read

  21. ACL(Access Control List) . ACL . Comma(,) . ACL .

  22. frontend.sparcs.org.ldif # Create top-level object in domain dn: dc=sparcs,dc=org objectClass: top objectClass: dcObject objectclass: organization o: SPARCS dc: sparcs description: Wheel Seminar LDAP Example # Admin user. dn: cn=admin,dc=sparcs,dc=org objectClass: simpleSecurityObject objectClass: organizationalRole cn: admin description: LDAP administrator userPassword: {SSHA}otkHcuPvZDGTKFt0EVZV4gNgzSboNY+S

  23. # ldapadd -x D cn=admin,dc=sparcs,dc=org -W -f frontend.sparcs.org.ldif

  24. ldapadd $ ldapadd D cn=admin,dc=sparcs,dc=org W f test.ldif <test.ldif> dn: cn=test,dc=sparcs,dc=org objectClass: inetOrgPerson cn: test sn: Ma

  25. ldapsearch $ ldapsearch -x -b base [options] filter [attributes]

  26. ldapsearch Filter Equality : uid=chaos Substring: uid=ch* Approximate: uid~=cha Less than, greater then: uid>=rodumani And: &(uid=chaos)(gidNumber=200) Or: |, Not: !,

  27. ldapsearch ldapsearch x b dc=sparcs,dc=org s sub * ldapsearch x b dc=sparcs,dc=org s sub cn=test

  28. ldapmodify $ ldapmodify D cn=admin,dc=sparcs,dc=org W f testmod.ldif <testmod.ldif> dn: cn=test,dc=sparcs,dc=org Changetype: modify Replace: sn sn: Lee

  29. ldapdelete $ ldapdelete -D "cn=admin,dc=sparcs,dc=org" -W "cn=test,dc=sparcs,dc=org"

  30. ldapmodrdn $ ldapmodrdn -D "cn=admin,dc=sparcs,dc=org" -W (-r) "cn=test,dc=sparcs,dc=org cn=temp dn: cn=temp,dc=sparcs,dc=org objectClass: inetOrgPerson cn: test cn: temp sn: Lee

  31. LDAP LDAP

  32. LDAP Authentication Installation Configuration LDAP .

  33. # apt-get install migrationtools # mv /usr/share/perl5/migrate_common.ph /usr/share/migrationtools/

  34. LDAP Authentication <migrate_common.ph> $DEFAULT_MAIL_DOMAIN = sparcs.org ; $DEFAULT_BASE = dc=sparcs,dc=org ; # cd /usr/share/migrationtools/ # ./migrate_group.pl /etc/group ~/group.ldif # ./migrate_passwd.pl /etc/passwd ~/passwd.ldif

  35. LDAP Authentication # vi ~/people_group.ldif dn: ou=People,dc=sparcs,dc=org ou: People objectClass: organizationalUnit dn: ou=Group,dc=sparcs,dc=org ou: Group objectClass: organizationalUnit

  36. LDAP Authentication # cd # ldapadd -D cn=admin,dc=sparcs,dc=org -W -f ~/people_group.ldif # ldapadd D cn=admin,dc=sparcs,dc=org -W -f ~/group.ldif # ldapadd D cn=admin,dc=sparcs,dc=org -W -f ~/passwd.ldif # /etc/init.d/slapd start

  37. LDAP Authentication # apt-get install libnss-ldap libpam-ldap nss-updatedb nscd ldap-auth-client Should debconf manage LDAP configuration? Yes LDAP server Uniform Resource Identifier: ldapi:/// ( ) Distinguished name of the search base: dc=sparcs,dc=org LDAP Version to use: 3 Make local root Database admin: Yes Does the LDAP database require login? No LDAP account for root: cn=admin,dc=sparcs,dc=org LDAP root account password: <LDAP >

  38. LDAP Authentication </etc/ldap.conf> host ( ) nss_base_passwd ou=People,dc=sparcs,dc=org nss_base_shadow ou=People,dc=sparcs,dc=org nss_base_group ou=Group,dc=sparcs,dc=org

  39. LDAP Authentication </etc/auth-client-config/profile.d/ ldap-auth-config> # auth-client-config a p lac_ldap

  40. LDAP Authentication </etc/pam.d/common-account> </etc/pam.d/common-auth>

  41. LDAP Authentication </etc/pam.d/common-password> </etc/nsswitch.conf>

  42. LDAP Authentication # nss_updatedb ldap # /etc/init.d/nscd restart

  43. LDAP Authentication . . getent passwd .

  44. LDAP Authentication # adduser * adduser . passwd LDAP . migrate_passwd.pl ldif ldapadd .

  45. LDAP Authentication LDAP . <test.ldif> # ldapmodify W D cn=admin,dc=sparcs,dc=org f ~/test.ldif

  46. https://help.ubuntu.com/10.04/serverguide/ openldap-server.html https://sparcs.kaist.ac.kr/wheel/wiki/Process es/NFS%2BLDAP 2011 LDAP by logue http://50001.com/sub/down/ldap.doc http://en.wikipedia.org/wiki/OpenLDAP

More Related Content