Removed *.cgi and web/Util.pm since they were moved to a special -cgi package
[mirror/userdir-ldap.git] / web / doc-direct.wml
1 #use wml::db.d.o title="Direct LDAP Access"
2
3 <p>
4 The LDAP utilities package provides a program called ldapsearch that can be
5 used to execute direct queries to the database. Generally this is done by
6 putting
7 <pre>
8 HOST db.debian.org
9 BASE dc=debian,dc=org
10 </pre>
11 in ~/.ldaprc. Then queries can be performed, for instance
12 <pre>
13 samosa{jgg}~#ldapsearch uid=wakkerma keyfingerprint
14 uid=wakkerma,ou=users,dc=debian,dc=org
15 keyfingerprint=38444C2CA6AD756EB4A2E5FA612AFF59
16 keyfingerprint=576E100B518D2F1636B028053CB892502FA3BC2D
17 </pre>
18 Shows the PGP key finger prints for the <tt>wakkerma</tt> user. The first word
19 in the command is the query to perform, the rest of command line are the 
20 attributes to return, if omitted then all readable attributes are returned. 
21 More complicated queries are possible, for instance:
22 <pre>
23 samosa{jgg}~#ldapsearch '(&(!(loginshell=/bin/bash))(uid=*))' loginshell
24 uid=admin,ou=users,dc=debian,dc=org
25
26 uid=mryan,ou=users,dc=debian,dc=org
27 loginshell=/usr/bin/tcsh
28
29 uid=jkominek,ou=users,dc=debian,dc=org
30 loginshell=/usr/bin/zsh
31
32 uid=caelum,ou=users,dc=debian,dc=org
33 loginshell=/usr/bin/zsh
34 [..]
35 </pre>
36 Shows users that do not use bash as their shell. Some other interesting
37 queries are:
38 <ul>
39 <li>Count the number of developers <tt>(&(keyfingerprint=*)(gidnumber=800))</tt>
40 <li>Show people in a certain group <tt>gidmembership=adm</tt>
41 <li>People named james <tt>cn=james</tt>
42 <li>Someone whos last name phonetically sounds like 'Ackerma' <tt>sn~=ackerm</tt>
43 <li>All the sparcs <tt>host=sparc</tt>
44 </ul>
45 <a href="http://info.internet.isi.edu:80/in-notes/rfc/files/rfc2254.txt">RFC 2254</a>
46 has more information about the filter expressions.
47
48 <h1>Other LDAP Browsers</h1>
49 <p>
50 The GQ package has a graphical LDAP browser that can browse the debian.org
51 tree. It is somewhat ungainly with the large number of entries in our
52 directory, but it does work nonetheless. Configuration is similar, use the
53 preferences dialog to add a new host with the information given above.
54 <p>
55 Netscape has a browser for their mailer, but I have never been able to get
56 it to work, please email if you have any luck.
57 <p>
58 To my knowledge there are no interfaces for popular mailers like mutt and
59 gnus. Such an interface would allow using the directory as an enhanced address
60 book.