move html into the cgi
[mirror/userdir-ldap-cgi.git] / html / doc-direct.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html lang="en">
3 <head>
4   <meta http-equiv="Content-Type" content="text/html; charset=">
5   <title>Debian Project -- Direct LDAP Access</title>
6   <link rev="made" href="mailto:webmaster@debian.org">
7   <meta name="Generator" content="WML 2.0.8 (30-Oct-2001)">
8   <meta name="Modified" content="2006-12-22 10:24:29">
9 </head>
10 <body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" alink="#FF0000">
11 <table width="100%" align="center" border="0" cellpadding="3" cellspacing="0" summary="">
12 <tr>
13   <td align="left" valign="middle">
14   <a href="http://www.debian.org/"><img src="http://www.debian.org/logos/openlogo-nd-50.png" border="0" hspace="0" vspace="0" alt=""></a>
15   <a href="http://www.debian.org/" rel="start"><img src="http://www.debian.org/Pics/debian.png" border="0" hspace="0" vspace="0" alt="Debian Project"></a>
16   </td>
17 </tr>
18 </table>
19 <!--UdmComment-->
20 <table bgcolor="#DF0451" border="0" cellpadding="0" cellspacing="0" width="100%" summary="">
21 <tr>
22 <td valign="top">
23 <img src="http://www.debian.org/Pics/red-upperleft.png" align="left" border="0" hspace="0" vspace="0" alt="">
24 </td>
25 <td rowspan="2" align="center">
26 <a href="http://www.debian.org/intro/about"><img src="http://www.debian.org/Pics/about.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="About Debian"></a>
27 <a href="http://www.debian.org/News/"><img src="http://www.debian.org/Pics/news.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="News"></a>
28 <a href="http://www.debian.org/distrib/"><img src="http://www.debian.org/Pics/getting.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="Getting Debian"></a>
29 <a href="http://www.debian.org/support"><img src="http://www.debian.org/Pics/support.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="Support"></a>
30 <a href="http://www.debian.org/devel/"><img src="http://www.debian.org/Pics/devel.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="Developers'&nbsp;Corner"></a>
31 <a href="http://www.debian.org/sitemap" rel="contents"><img src="http://www.debian.org/Pics/sitemap.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="Site map"></a>
32 <a href="http://search.debian.org/"><img src="http://www.debian.org/Pics/search.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="Search"></a>
33 </td>
34 <td valign="top">
35 <img src="http://www.debian.org/Pics/red-upperright.png" align="right" border="0" hspace="0" vspace="0" alt="">
36 </td>
37 </tr>
38 <tr>
39 <td valign="bottom">
40 <img src="http://www.debian.org/Pics/red-lowerleft.png" align="left" border="0" hspace="0" vspace="0" alt="">
41 </td>
42 <td valign="bottom">
43 <img src="http://www.debian.org/Pics/red-lowerright.png" align="right" border="0" hspace="0" vspace="0" alt="">
44 </td>
45 </tr>
46 </table>
47 <!--/UdmComment-->
48 <h1>Direct LDAP Access</h1>
49 <p>Since the
50 <a href="http://lists.debian.org/debian-announce/debian-announce-2003/msg00001.html">compromise</a>,
51 the information available to non-developers via the LDAP interface has been
52 limited a great deal. However, as always, the full database is accessible from
53 any .debian.org machine. If you wish relatively unfettered access to the LDAP
54 database, connect to it from a .debian.org machine, such as gluck.debian.org
55 (which is recommended for general shell usage anyhow).
56 </p>
57 <p>
58 The LDAP utilities package (<a href="http://packages.debian.org/ldap-utils">ldap-utils</a>) provides an utility called ldapsearch that can be used
59 to execute direct queries to the database. This is done by supplying
60 the following arguments to ldapsearch: <strong>-x -H
61 ldap://db.debian.org -b dc=debian,dc=org</strong>. Alternatively, the
62 <strong>-H</strong> and <strong>-b</strong> options can be put in
63 one's ~/.ldaprc, in the following form:
64 </p><pre>
65 [ dbharris@gluck: ~/ ]$ cat ~/.ldaprc
66 HOST db.debian.org
67 BASE dc=debian,dc=org
68 </pre>
69 <p>
70 <strong>-x</strong> tells ldapsearch to use "simple" (non-SASL, non-Kerberos)
71 authentication. There appears to be no ~/.ldaprc option which does the same as
72 <strong>-x</strong>. With these parameters specified, we're ready to begin
73 searching. Here's an example:
74 </p><pre>
75 [ dbharris@gluck: ~/ ]$ ldapsearch -x uid=dbharris keyfingerprint
76 &lt;snip&gt;
77 dn: uid=dbharris,ou=users,dc=debian,dc=org
78 keyFingerPrint: CC53F12435C07BC258FE7A3C157DDFD959DDCB9F
79 &lt;snip&gt;
80 </pre>
81 <p>
82 The first non-option argument (<strong>uid=dbharris</strong> in this case) is
83 the query to perform, and the rest of the arguments are the attributes to
84 return. If you only specify the query, but don't provide any attributes to
85 return, all readable attributes are returned. While the example was quite
86 simple, complex queries can be performed as well:
87 </p><pre>
88 [ dbharris@gluck: ~/ ]$ ldapsearch -x -H ldap://db.debian.org -b dc=debian,dc=org '(&amp;(!(loginshell=/bin/bash))(uid=*))' loginshell
89 </pre>
90 <p>
91 That query shows users that do not use bash as their shell. Some other
92 interesting queries are:</p>
93 <ul>
94 <li>Count the number of developers
95 <tt>(&amp;(keyfingerprint=*)(gidnumber=800))</tt></li>
96 <li>Show people in a certain group <tt>gidmembership=adm</tt></li>
97 <li>People named james <tt>cn=james</tt></li>
98 <li>Someone whos last name phonetically sounds like 'Ackerma'
99 <tt>sn~=ackerm</tt></li>
100 <li>All the sparcs <tt>host=sparc</tt></li>
101 </ul>
102 <p><a href="http://www.faqs.org/rfcs/rfc2254.html">RFC 2254</a>
103 has more information about the filter expressions.</p>
104 <h1>Other LDAP Browsers</h1>
105 <p>
106 The GQ package has a graphical LDAP browser that can browse the debian.org
107 tree. It is somewhat ungainly with the large number of entries in our
108 directory, but it does work nonetheless. Configuration is similar, use the
109 preferences dialog to add a new host with the information given above.
110 <p>
111 Netscape has a browser for their mailer, but I have never been able to get
112 it to work, please email if you have any luck.
113 <p>
114 To my knowledge there are no interfaces for popular mailers like mutt and
115 gnus. Such an interface would allow using the directory as an enhanced address
116 book.
117 <hr noshade width="100%" size="1">
118 Back to the <a href="http://www.debian.org/">Debian Project homepage</a>.
119 <hr noshade width="100%" size="1">
120 <small>
121 You can contact us at
122 <a href="mailto:admin@db.debian.org">admin@db.debian.org</a>.
123 </small>
124 <p>
125 <p><small>
126 Last Modified: Fri, Jan 28 19:13:06 UTC 2005
127   <br>
128   Copyright &copy; 1997-2005
129  <a href="http://www.spi-inc.org/">SPI</a>; See <a href="http://www.debian.org/license" rel="copyright">license terms</a><br>
130   Debian is a registered trademark of Software in the Public Interest, Inc.
131 </small></p>
132 </body>
133 </html>