1 #use wml::db.d.o title="Direct LDAP Access"
4 <a href="http://lists.debian.org/debian-announce/debian-announce-2003/msg00001.html">compromise</a>,
5 the information available to non-developers via the LDAP interface has been
6 limited a great deal. However, as always, the full database is accessible from
7 any .debian.org machine. If you wish relatively unfettered access to the LDAP
8 database, connect to it from a .debian.org machine, such as ravel.debian.org
9 (which is recommended for general shell usage anyhow).
13 The LDAP utilities package (<a href="http://packages.debian.org/ldap-utils">\
14 ldap-utils</a>) provides an utility called ldapsearch that can be used
15 to execute direct queries to the database. This is done by supplying
16 the following arguments to ldapsearch: <strong>-x -H
17 ldap://db.debian.org -b dc=debian,dc=org</strong>. Alternatively, the
18 <strong>-H</strong> and <strong>-b</strong> options can be put in
19 one's ~/.ldaprc, in the following form:
21 [ dbharris@ravel: ~/ ]$ cat ~/.ldaprc
27 <strong>-x</strong> tells ldapsearch to use "simple" (non-SASL, non-Kerberos)
28 authentication. There appears to be no ~/.ldaprc option which does the same as
29 <strong>-x</strong>. With these parameters specified, we're ready to begin
30 searching. Here's an example:
32 [ dbharris@ravel: ~/ ]$ ldapsearch -x uid=dbharris keyfingerprint
34 # dbharris, users, debian, org
35 dn: uid=dbharris,ou=users,dc=debian,dc=org
36 keyFingerPrint: CC53F12435C07BC258FE7A3C157DDFD959DDCB9F
41 The first non-option argument (<strong>uid=dbharris</strong> in this case) is
42 the query to perform, and the rest of the arguments are the attributes to
43 return. If you only specify the query, but don't provide any attributes to
44 return, all readable attributes are returned. While the example was quite
45 simple, complex queries can be performed as well:
47 [ dbharris@ravel: ~/ ]$ ldapsearch -x -H ldap://db.debian.org -b dc=debian,dc=org '(&(!(loginshell=/bin/bash))(uid=*))' loginshell
51 That query shows users that do not use bash as their shell. Some other
52 interesting queries are:</p>
54 <li>Count the number of developers
55 <tt>(&(keyfingerprint=*)(gidnumber=800))</tt></li>
56 <li>Show people in a certain group <tt>gidmembership=adm</tt></li>
57 <li>People named james <tt>cn=james</tt></li>
58 <li>Someone whos last name phonetically sounds like 'Ackerma'
59 <tt>sn~=ackerm</tt></li>
60 <li>All the sparcs <tt>host=sparc</tt></li>
63 <p><a href="http://www.faqs.org/rfcs/rfc2254.html">RFC 2254</a>
64 has more information about the filter expressions.</p>
67 <h1>Other LDAP Browsers</h1>
69 The GQ package has a graphical LDAP browser that can browse the debian.org
70 tree. It is somewhat ungainly with the large number of entries in our
71 directory, but it does work nonetheless. Configuration is similar, use the
72 preferences dialog to add a new host with the information given above.
74 Netscape has a browser for their mailer, but I have never been able to get
75 it to work, please email if you have any luck.
77 To my knowledge there are no interfaces for popular mailers like mutt and
78 gnus. Such an interface would allow using the directory as an enhanced address