9dc1f48f1f3c547ac3703204f261153e5d50c651
[mirror/userdir-ldap.git] / web / 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 GNU/Linux -- Direct LDAP Access</title>
6 <link rev="made" href="mailto:webmaster@debian.org">
7 <meta name="Description" content="Debian GNU/Linux is a free distribution of the GNU/Linux operating system. It is maintained and updated through the work of many users who volunteer their time and effort.">
8 <meta name="Keywords" content="debian, GNU, linux, unix, open source, free, DFSG">
9 <meta name="Language" content="">
10 <meta name="Author"    content="Debian Webmaster, webmaster@debian.org">
11 <meta name="Generator" content="WML 2.0.8 (30-Oct-2001)">
12 <meta name="Modified"  content="2002-07-12 19:23:30">
13 </head>
14 <body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#800080" alink="#FF0000">
15 <table width="100%" align="center" border="0" cellpadding="3" cellspacing="0" summary="">
16 <tr>
17   <td align="left" valign="middle">
18   <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>
19   <a href="http://www.debian.org/"><img src="http://www.debian.org/Pics/debian.jpg" border="0" hspace="0" vspace="0" alt="Debian Project"></a>
20   </td>
21 </tr>
22 </table>
23 <!--UdmComment-->
24 <table bgcolor="#DF0451" border="0" cellpadding="0" cellspacing="0" width="100%" summary="">
25 <tr>
26 <td valign="top">
27 <img src="http://www.debian.org/Pics/red-upperleft.png" align="left" border="0" hspace="0" vspace="0" alt="">
28 </td>
29 <td rowspan="2" align="center">
30 <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>
31 <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>
32 <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>
33 <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>
34 <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>
35 <a href="http://www.debian.org/sitemap"><img src="http://www.debian.org/Pics/sitemap.en.gif" align="middle" border="0" hspace="4" vspace="7" alt="Site map"></a>
36 <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>
37 </td>
38 <td valign="top">
39 <img src="http://www.debian.org/Pics/red-upperright.png" align="right" border="0" hspace="0" vspace="0" alt="">
40 </td>
41 </tr>
42 <tr>
43 <td valign="bottom">
44 <img src="http://www.debian.org/Pics/red-lowerleft.png" align="left" border="0" hspace="0" vspace="0" alt="">
45 </td>
46 <td valign="bottom">
47 <img src="http://www.debian.org/Pics/red-lowerright.png" align="right" border="0" hspace="0" vspace="0" alt="">
48 </td>
49 </tr>
50 </table>
51 <!--/UdmComment-->
52 <h1>Direct LDAP Access</h1>
53 <p>
54 The LDAP utilities package provides a program called ldapsearch that can be
55 used to execute direct queries to the database. Generally this is done by
56 putting
57 <pre>
58 HOST db.debian.org
59 BASE dc=debian,dc=org
60 </pre>
61 in ~/.ldaprc. Then queries can be performed, for instance
62 <pre>
63 samosa{jgg}~#ldapsearch uid=wakkerma keyfingerprint
64 uid=wakkerma,ou=users,dc=debian,dc=org
65 keyfingerprint=38444C2CA6AD756EB4A2E5FA612AFF59
66 keyfingerprint=576E100B518D2F1636B028053CB892502FA3BC2D
67 </pre>
68 Shows the PGP key finger prints for the <tt>wakkerma</tt> user. The first word
69 in the command is the query to perform, the rest of command line are the
70 attributes to return, if omitted then all readable attributes are returned.
71 More complicated queries are possible, for instance:
72 <pre>
73 samosa{jgg}~#ldapsearch '(&(!(loginshell=/bin/bash))(uid=*))' loginshell
74 uid=admin,ou=users,dc=debian,dc=org
75
76 uid=mryan,ou=users,dc=debian,dc=org
77 loginshell=/usr/bin/tcsh
78
79 uid=jkominek,ou=users,dc=debian,dc=org
80 loginshell=/usr/bin/zsh
81
82 uid=caelum,ou=users,dc=debian,dc=org
83 loginshell=/usr/bin/zsh
84 [..]
85 </pre>
86 Shows users that do not use bash as their shell. Some other interesting
87 queries are:
88 <ul>
89 <li>Count the number of developers <tt>(&(keyfingerprint=*)(gidnumber=800))</tt>
90 <li>Show people in a certain group <tt>gidmembership=adm</tt>
91 <li>People named james <tt>cn=james</tt>
92 <li>Someone whos last name phonetically sounds like 'Ackerma' <tt>sn~=ackerm</tt>
93 <li>All the sparcs <tt>host=sparc</tt>
94 </ul>
95 <a href="http://info.internet.isi.edu:80/in-notes/rfc/files/rfc2254.txt">RFC 2254</a>
96 has more information about the filter expressions.
97 <h1>Other LDAP Browsers</h1>
98 <p>
99 The GQ package has a graphical LDAP browser that can browse the debian.org
100 tree. It is somewhat ungainly with the large number of entries in our
101 directory, but it does work nonetheless. Configuration is similar, use the
102 preferences dialog to add a new host with the information given above.
103 <p>
104 Netscape has a browser for their mailer, but I have never been able to get
105 it to work, please email if you have any luck.
106 <p>
107 To my knowledge there are no interfaces for popular mailers like mutt and
108 gnus. Such an interface would allow using the directory as an enhanced address
109 book.
110 <hr noshade width="100%" size="1">
111 Back to the <a href="http://www.debian.org/">Debian Project homepage</a>.
112 <hr noshade width="100%" size="1">
113 <small>
114 You can contact us at
115 <a href="mailto:admin@db.debian.org">admin@db.debian.org</a>.
116 </small>
117 <p>
118 <small>
119 Last Modified: Fri, Jul 12 17:23:30 UTC 2002
120   <br>
121   Copyright &copy; 1997-2002
122  <a href="http://www.spi-inc.org/">SPI</a>; See <a href="http://www.debian.org/license">license terms</a>
123 </small>
124 </body>
125 </html>