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