1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries tagged ldap
</title>
5 <description>Entries tagged ldap
</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>How to add extra storage servers in Debian Edu / Skolelinux
</title>
11 <link>http://people.skolelinux.org/pere/blog/How_to_add_extra_storage_servers_in_Debian_Edu___Skolelinux.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/How_to_add_extra_storage_servers_in_Debian_Edu___Skolelinux.html
</guid>
13 <pubDate>Fri,
14 Mar
2014 12:
50:
00 +
0100</pubDate>
14 <description><p
>On larger sites, it is useful to use a dedicated storage server for
15 storing user home directories and data. The design for handling this
16 in
<a href=
"http://www.skolelinux.org/
">Debian Edu / Skolelinux
</a
>, is
17 to update the automount rules in LDAP and let the automount daemon on
18 the clients take care of the rest. I was reminded about the need to
19 document this better when one of the customers of
20 <a href=
"http://www.slxdrift.no/
">Skolelinux Drift AS
</a
>, where I am
21 on the board of directors, asked about how to do this. The steps to
22 get this working are the following:
</p
>
26 <li
>Add new storage server in DNS. I use nas-server.intern as the
27 example host here.
</li
>
29 <li
>Add automoun LDAP information about this server in LDAP, to allow
30 all clients to automatically mount it on reqeust.
</li
>
32 <li
>Add the relevant entries in tjener.intern:/etc/fstab, because
33 tjener.intern do not use automount to avoid mounting loops.
</li
>
37 <p
>DNS entries are added in GOsa², and not described here. Follow the
38 <a href=
"https://wiki.debian.org/DebianEdu/Documentation/Wheezy/GettingStarted
">instructions
39 in the manual
</a
> (Machine Management with GOsa² in section etting
42 <p
>Ensure that the NFS export points on the server are exported to the
43 relevant subnets or machines:
</p
>
45 <p
><blockquote
><pre
>
46 root@tjener:~# showmount -e nas-server
47 Export list for nas-server:
50 </pre
></blockquote
></p
>
52 <p
>Here everything on the backbone network is granted access to the
53 /storage export. With NFSv3 it is slightly better to limit it to
54 netgroup membership or single IP addresses to have some limits on the
57 <p
>The next step is to update LDAP. This can not be done using GOsa²,
58 because it lack a module for automount. Instead, use ldapvi and add
59 the required LDAP objects using an editor.
</p
>
61 <p
><blockquote
><pre
>
62 ldapvi --ldap-conf -ZD
'(cn=admin)
' -b ou=automount,dc=skole,dc=skolelinux,dc=no
63 </pre
></blockquote
></p
>
65 <p
>When the editor show up, add the following LDAP objects at the
66 bottom of the document. The
"/
&" part in the last LDAP object is a
67 wild card matching everything the nas-server exports, removing the
68 need to list individual mount points in LDAP.
</p
>
70 <p
><blockquote
><pre
>
71 add cn=nas-server,ou=auto.skole,ou=automount,dc=skole,dc=skolelinux,dc=no
72 objectClass: automount
74 automountInformation: -fstype=autofs --timeout=
60 ldap:ou=auto.nas-server,ou=automount,dc=skole,dc=skolelinux,dc=no
76 add ou=auto.nas-server,ou=automount,dc=skole,dc=skolelinux,dc=no
78 objectClass: automountMap
81 add cn=/,ou=auto.nas-server,ou=automount,dc=skole,dc=skolelinux,dc=no
82 objectClass: automount
84 automountInformation: -fstype=nfs,tcp,rsize=
32768,wsize=
32768,rw,intr,hard,nodev,nosuid,noatime nas-server.intern:/
&
85 </pre
></blockquote
></p
>
87 <p
>The last step to remember is to mount the relevant mount points in
88 tjener.intern by adding them to /etc/fstab, creating the mount
89 directories using mkdir and running
"mount -a
" to mount them.
</p
>
91 <p
>When this is done, your users should be able to access the files on
92 the storage server directly by just visiting the
93 /tjener/nas-server/storage/ directory using any application on any
94 workstation, LTSP client or LTSP server.
</p
>
99 <title>What are they searching for - PowerDNS and ISC DHCP in LDAP
</title>
100 <link>http://people.skolelinux.org/pere/blog/What_are_they_searching_for___PowerDNS_and_ISC_DHCP_in_LDAP.html
</link>
101 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/What_are_they_searching_for___PowerDNS_and_ISC_DHCP_in_LDAP.html
</guid>
102 <pubDate>Sat,
17 Jul
2010 21:
00:
00 +
0200</pubDate>
103 <description><p
>This is a
104 <a href=
"http://people.skolelinux.org/pere/blog/Time_for_new__LDAP_schemas_replacing_RFC_2307_.html
">followup
</a
>
106 <a href=
"http://people.skolelinux.org/pere/blog/Idea_for_a_change_to_LDAP_schemas_allowing_DNS_and_DHCP_info_to_be_combined_into_one_object.html
">previous
108 <a href=
"http://people.skolelinux.org/pere/blog/Combining_PowerDNS_and_ISC_DHCP_LDAP_objects.html
">merging
109 all
</a
> the computer related LDAP objects in Debian Edu.
</p
>
111 <p
>As a step to try to see if it possible to merge the DNS and DHCP
112 LDAP objects, I have had a look at how the packages pdns-backend-ldap
113 and dhcp3-server-ldap in Debian use the LDAP server. The two
114 implementations are quite different in how they use LDAP.
</p
>
116 To get this information, I started slapd with debugging enabled and
117 dumped the debug output to a file to get the LDAP searches performed
118 on a Debian Edu main-server. Here is a summary.
120 <p
><strong
>powerdns
</strong
></p
>
122 <a href=
"http://www.linuxnetworks.de/doc/index.php/PowerDNS_LDAP_Backend
">Clues
123 on how to
</a
> set up PowerDNS to use a LDAP backend is available on
126 <p
>PowerDNS have two modes of operation using LDAP as its backend.
127 One
"strict
" mode where the forward and reverse DNS lookups are done
128 using the same LDAP objects, and a
"tree
" mode where the forward and
129 reverse entries are in two different subtrees in LDAP with a structure
130 based on the DNS names, as in tjener.intern and
131 2.2.0.10.in-addr.arpa.
</p
>
133 <p
>In tree mode, the server is set up to use a LDAP subtree as its
134 base, and uses a
"base
" scoped search for the DNS name by adding
135 "dc=tjener,dc=intern,
" to the base with a filter for
136 "(associateddomain=tjener.intern)
" for the forward entry and
137 "dc=
2,dc=
2,dc=
0,dc=
10,dc=in-addr,dc=arpa,
" with a filter for
138 "(associateddomain=
2.2.0.10.in-addr.arpa)
" for the reverse entry. For
139 forward entries, it is looking for attributes named dnsttl, arecord,
140 nsrecord, cnamerecord, soarecord, ptrrecord, hinforecord, mxrecord,
141 txtrecord, rprecord, afsdbrecord, keyrecord, aaaarecord, locrecord,
142 srvrecord, naptrrecord, kxrecord, certrecord, dsrecord, sshfprecord,
143 ipseckeyrecord, rrsigrecord, nsecrecord, dnskeyrecord, dhcidrecord,
144 spfrecord and modifytimestamp. For reverse entries it is looking for
145 the attributes dnsttl, arecord, nsrecord, cnamerecord, soarecord,
146 ptrrecord, hinforecord, mxrecord, txtrecord, rprecord, aaaarecord,
147 locrecord, srvrecord, naptrrecord and modifytimestamp. The equivalent
148 ldapsearch commands could look like this:
</p
>
150 <blockquote
><pre
>
152 -b dc=tjener,dc=intern,ou=hosts,dc=skole,dc=skolelinux,dc=no \
153 -s base -x
'(associateddomain=tjener.intern)
' dNSTTL aRecord nSRecord \
154 cNAMERecord sOARecord pTRRecord hInfoRecord mXRecord tXTRecord \
155 rPRecord aFSDBRecord KeyRecord aAAARecord lOCRecord sRVRecord \
156 nAPTRRecord kXRecord certRecord dSRecord sSHFPRecord iPSecKeyRecord \
157 rRSIGRecord nSECRecord dNSKeyRecord dHCIDRecord sPFRecord modifyTimestamp
160 -b dc=
2,dc=
2,dc=
0,dc=
10,dc=in-addr,dc=arpa,ou=hosts,dc=skole,dc=skolelinux,dc=no \
161 -s base -x
'(associateddomain=
2.2.0.10.in-addr.arpa)
'
162 dnsttl, arecord, nsrecord, cnamerecord soarecord ptrrecord \
163 hinforecord mxrecord txtrecord rprecord aaaarecord locrecord \
164 srvrecord naptrrecord modifytimestamp
165 </pre
></blockquote
>
167 <p
>In Debian Edu/Lenny, the PowerDNS tree mode is used with
168 ou=hosts,dc=skole,dc=skolelinux,dc=no as the base, and these are two
169 example LDAP objects used there. In addition to these objects, the
170 parent objects all th way up to ou=hosts,dc=skole,dc=skolelinux,dc=no
171 also exist.
</p
>
173 <blockquote
><pre
>
174 dn: dc=tjener,dc=intern,ou=hosts,dc=skole,dc=skolelinux,dc=no
176 objectclass: dnsdomain
177 objectclass: domainrelatedobject
180 associateddomain: tjener.intern
182 dn: dc=
2,dc=
2,dc=
0,dc=
10,dc=in-addr,dc=arpa,ou=hosts,dc=skole,dc=skolelinux,dc=no
184 objectclass: dnsdomain2
185 objectclass: domainrelatedobject
187 ptrrecord: tjener.intern
188 associateddomain:
2.2.0.10.in-addr.arpa
189 </pre
></blockquote
>
191 <p
>In strict mode, the server behaves differently. When looking for
192 forward DNS entries, it is doing a
"subtree
" scoped search with the
193 same base as in the tree mode for a object with filter
194 "(associateddomain=tjener.intern)
" and requests the attributes dnsttl,
195 arecord, nsrecord, cnamerecord, soarecord, ptrrecord, hinforecord,
196 mxrecord, txtrecord, rprecord, aaaarecord, locrecord, srvrecord,
197 naptrrecord and modifytimestamp. For reverse entires it also do a
198 subtree scoped search but this time the filter is
"(arecord=
10.0.2.2)
"
199 and the requested attributes are associateddomain, dnsttl and
200 modifytimestamp. In short, in strict mode the objects with ptrrecord
201 go away, and the arecord attribute in the forward object is used
204 <p
>The forward and reverse searches can be simulated using ldapsearch
207 <blockquote
><pre
>
208 ldapsearch -h ldap -b ou=hosts,dc=skole,dc=skolelinux,dc=no -s sub -x \
209 '(associateddomain=tjener.intern)
' dNSTTL aRecord nSRecord \
210 cNAMERecord sOARecord pTRRecord hInfoRecord mXRecord tXTRecord \
211 rPRecord aFSDBRecord KeyRecord aAAARecord lOCRecord sRVRecord \
212 nAPTRRecord kXRecord certRecord dSRecord sSHFPRecord iPSecKeyRecord \
213 rRSIGRecord nSECRecord dNSKeyRecord dHCIDRecord sPFRecord modifyTimestamp
215 ldapsearch -h ldap -b ou=hosts,dc=skole,dc=skolelinux,dc=no -s sub -x \
216 '(arecord=
10.0.2.2)
' associateddomain dnsttl modifytimestamp
217 </pre
></blockquote
>
219 <p
>In addition to the forward and reverse searches , there is also a
220 search for SOA records, which behave similar to the forward and
221 reverse lookups.
</p
>
223 <p
>A thing to note with the PowerDNS behaviour is that it do not
224 specify any objectclass names, and instead look for the attributes it
225 need to generate a DNS reply. This make it able to work with any
226 objectclass that provide the needed attributes.
</p
>
228 <p
>The attributes are normally provided in the cosine (RFC
1274) and
229 dnsdomain2 schemas. The latter is used for reverse entries like
230 ptrrecord and recent DNS additions like aaaarecord and srvrecord.
</p
>
232 <p
>In Debian Edu, we have created DNS objects using the object classes
233 dcobject (for dc), dnsdomain or dnsdomain2 (structural, for the DNS
234 attributes) and domainrelatedobject (for associatedDomain). The use
235 of structural object classes make it impossible to combine these
236 classes with the object classes used by DHCP.
</p
>
238 <p
>There are other schemas that could be used too, for example the
239 dnszone structural object class used by Gosa and bind-sdb for the DNS
240 attributes combined with the domainrelatedobject object class, but in
241 this case some unused attributes would have to be included as well
242 (zonename and relativedomainname).
</p
>
244 <p
>My proposal for Debian Edu would be to switch PowerDNS to strict
245 mode and not use any of the existing objectclasses (dnsdomain,
246 dnsdomain2 and dnszone) when one want to combine the DNS information
247 with DHCP information, and instead create a auxiliary object class
248 defined something like this (using the attributes defined for
249 dnsdomain and dnsdomain2 or dnszone):
</p
>
251 <blockquote
><pre
>
252 objectclass ( some-oid NAME
'dnsDomainAux
'
255 MAY ( ARecord $ MDRecord $ MXRecord $ NSRecord $ SOARecord $ CNAMERecord $
256 DNSTTL $ DNSClass $ PTRRecord $ HINFORecord $ MINFORecord $
257 TXTRecord $ SIGRecord $ KEYRecord $ AAAARecord $ LOCRecord $
258 NXTRecord $ SRVRecord $ NAPTRRecord $ KXRecord $ CERTRecord $
259 A6Record $ DNAMERecord
261 </pre
></blockquote
>
263 <p
>This will allow any object to become a DNS entry when combined with
264 the domainrelatedobject object class, and allow any entity to include
265 all the attributes PowerDNS wants. I
've sent an email to the PowerDNS
266 developers asking for their view on this schema and if they are
267 interested in providing such schema with PowerDNS, and I hope my
268 message will be accepted into their mailing list soon.
</p
>
270 <p
><strong
>ISC dhcp
</strong
></p
>
272 <p
>The DHCP server searches for specific objectclass and requests all
273 the object attributes, and then uses the attributes it want. This
274 make it harder to figure out exactly what attributes are used, but
275 thanks to the working example in Debian Edu I can at least get an idea
276 what is needed without having to read the source code.
</p
>
278 <p
>In the DHCP server configuration, the LDAP base to use and the
279 search filter to use to locate the correct dhcpServer entity is
280 stored. These are the relevant entries from
281 /etc/dhcp3/dhcpd.conf:
</p
>
283 <blockquote
><pre
>
284 ldap-base-dn
"dc=skole,dc=skolelinux,dc=no
";
285 ldap-dhcp-server-cn
"dhcp
";
286 </pre
></blockquote
>
288 <p
>The DHCP server uses this information to nest all the DHCP
289 configuration it need. The cn
"dhcp
" is located using the given LDAP
290 base and the filter
"(
&(objectClass=dhcpServer)(cn=dhcp))
". The
291 search result is this entry:
</p
>
293 <blockquote
><pre
>
294 dn: cn=dhcp,dc=skole,dc=skolelinux,dc=no
297 objectClass: dhcpServer
298 dhcpServiceDN: cn=DHCP Config,dc=skole,dc=skolelinux,dc=no
299 </pre
></blockquote
>
301 <p
>The content of the dhcpServiceDN attribute is next used to locate the
302 subtree with DHCP configuration. The DHCP configuration subtree base
303 is located using a base scope search with base
"cn=DHCP
304 Config,dc=skole,dc=skolelinux,dc=no
" and filter
305 "(
&(objectClass=dhcpService)(|(dhcpPrimaryDN=cn=dhcp,dc=skole,dc=skolelinux,dc=no)(dhcpSecondaryDN=cn=dhcp,dc=skole,dc=skolelinux,dc=no)))
".
306 The search result is this entry:
</p
>
308 <blockquote
><pre
>
309 dn: cn=DHCP Config,dc=skole,dc=skolelinux,dc=no
312 objectClass: dhcpService
313 objectClass: dhcpOptions
314 dhcpPrimaryDN: cn=dhcp, dc=skole,dc=skolelinux,dc=no
315 dhcpStatements: ddns-update-style none
316 dhcpStatements: authoritative
317 dhcpOption: smtp-server code
69 = array of ip-address
318 dhcpOption: www-server code
72 = array of ip-address
319 dhcpOption: wpad-url code
252 = text
320 </pre
></blockquote
>
322 <p
>Next, the entire subtree is processed, one level at the time. When
323 all the DHCP configuration is loaded, it is ready to receive requests.
324 The subtree in Debian Edu contain objects with object classes
325 top/dhcpService/dhcpOptions, top/dhcpSharedNetwork/dhcpOptions,
326 top/dhcpSubnet, top/dhcpGroup and top/dhcpHost. These provide options
327 and information about netmasks, dynamic range etc. Leaving out the
328 details here because it is not relevant for the focus of my
329 investigation, which is to see if it is possible to merge dns and dhcp
330 related computer objects.
</p
>
332 <p
>When a DHCP request come in, LDAP is searched for the MAC address
333 of the client (
00:
00:
00:
00:
00:
00 in this example), using a subtree
334 scoped search with
"cn=DHCP Config,dc=skole,dc=skolelinux,dc=no
" as
335 the base and
"(
&(objectClass=dhcpHost)(dhcpHWAddress=ethernet
336 00:
00:
00:
00:
00:
00))
" as the filter. This is what a host object look
339 <blockquote
><pre
>
340 dn: cn=hostname,cn=group1,cn=THINCLIENTS,cn=DHCP Config,dc=skole,dc=skolelinux,dc=no
343 objectClass: dhcpHost
344 dhcpHWAddress: ethernet
00:
00:
00:
00:
00:
00
345 dhcpStatements: fixed-address hostname
346 </pre
></blockquote
>
348 <p
>There is less flexiblity in the way LDAP searches are done here.
349 The object classes need to have fixed names, and the configuration
350 need to be stored in a fairly specific LDAP structure. On the
351 positive side, the invidiual dhcpHost entires can be anywhere without
352 the DN pointed to by the dhcpServer entries. The latter should make
353 it possible to group all host entries in a subtree next to the
354 configuration entries, and this subtree can also be shared with the
355 DNS server if the schema proposed above is combined with the dhcpHost
356 structural object class.
358 <p
><strong
>Conclusion
</strong
></p
>
360 <p
>The PowerDNS implementation seem to be very flexible when it come
361 to which LDAP schemas to use. While its
"tree
" mode is rigid when it
362 come to the the LDAP structure, the
"strict
" mode is very flexible,
363 allowing DNS objects to be stored anywhere under the base cn specified
364 in the configuration.
</p
>
366 <p
>The DHCP implementation on the other hand is very inflexible, both
367 regarding which LDAP schemas to use and which LDAP structure to use.
368 I guess one could implement ones own schema, as long as the
369 objectclasses and attributes have the names used, but this do not
370 really help when the DHCP subtree need to have a fairly fixed
373 <p
>Based on the observed behaviour, I suspect a LDAP structure like
374 this might work for Debian Edu:
</p
>
376 <blockquote
><pre
>
378 cn=machine-info (dhcpService) - dhcpServiceDN points here
380 cn=dhcp-internal (dhcpSharedNetwork/dhcpOptions)
381 cn=
10.0.2.0 (dhcpSubnet)
382 cn=group1 (dhcpGroup/dhcpOptions)
383 cn=dhcp-thinclients (dhcpSharedNetwork/dhcpOptions)
384 cn=
192.168.0.0 (dhcpSubnet)
385 cn=group1 (dhcpGroup/dhcpOptions)
386 ou=machines - PowerDNS base points here
387 cn=hostname (dhcpHost/domainrelatedobject/dnsDomainAux)
388 </pre
></blockquote
>
390 <P
>This is not tested yet. If the DHCP server require the dhcpHost
391 entries to be in the dhcpGroup subtrees, the entries can be stored
392 there instead of a common machines subtree, and the PowerDNS base
393 would have to be moved one level up to the machine-info subtree.
</p
>
395 <p
>The combined object under the machines subtree would look something
398 <blockquote
><pre
>
399 dn: dc=hostname,ou=machines,cn=machine-info,dc=skole,dc=skolelinux,dc=no
402 objectClass: dhcpHost
403 objectclass: domainrelatedobject
404 objectclass: dnsDomainAux
405 associateddomain: hostname.intern
407 dhcpHWAddress: ethernet
00:
00:
00:
00:
00:
00
408 dhcpStatements: fixed-address hostname.intern
409 </pre
></blockquote
>
411 </p
>One could even add the LTSP configuration associated with a given
412 machine, as long as the required attributes are available in a
413 auxiliary object class.
</p
>
418 <title>Combining PowerDNS and ISC DHCP LDAP objects
</title>
419 <link>http://people.skolelinux.org/pere/blog/Combining_PowerDNS_and_ISC_DHCP_LDAP_objects.html
</link>
420 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Combining_PowerDNS_and_ISC_DHCP_LDAP_objects.html
</guid>
421 <pubDate>Wed,
14 Jul
2010 23:
45:
00 +
0200</pubDate>
422 <description><p
>For a while now, I have wanted to find a way to change the DNS and
423 DHCP services in Debian Edu to use the same LDAP objects for a given
424 computer, to avoid the possibility of having a inconsistent state for
425 a computer in LDAP (as in DHCP but no DNS entry or the other way
426 around) and make it easier to add computers to LDAP.
</p
>
428 <p
>I
've looked at how powerdns and dhcpd is using LDAP, and using this
429 information finally found a solution that seem to work.
</p
>
431 <p
>The old setup required three LDAP objects for a given computer.
432 One forward DNS entry, one reverse DNS entry and one DHCP entry. If
433 we switch powerdns to use its strict LDAP method (ldap-method=strict
434 in pdns-debian-edu.conf), the forward and reverse DNS entries are
435 merged into one while making it impossible to transfer the reverse map
436 to a slave DNS server.
</p
>
438 <p
>If we also replace the object class used to get the DNS related
439 attributes to one allowing these attributes to be combined with the
440 dhcphost object class, we can merge the DNS and DHCP entries into one.
441 I
've written such object class in the dnsdomainaux.schema file (need
442 proper OIDs, but that is a minor issue), and tested the setup. It
443 seem to work.
</p
>
445 <p
>With this test setup in place, we can get away with one LDAP object
446 for both DNS and DHCP, and even the LTSP configuration I suggested in
447 an earlier email. The combined LDAP object will look something like
450 <blockquote
><pre
>
451 dn: cn=hostname,cn=group1,cn=THINCLIENTS,cn=DHCP Config,dc=skole,dc=skolelinux,dc=no
453 objectClass: dhcphost
454 objectclass: domainrelatedobject
455 objectclass: dnsdomainaux
456 associateddomain: hostname.intern
458 dhcphwaddress: ethernet
00:
00:
00:
00:
00:
00
459 dhcpstatements: fixed-address hostname
461 </pre
></blockquote
>
463 <p
>The DNS server uses the associateddomain and arecord entries, while
464 the DHCP server uses the dhcphwaddress and dhcpstatements entries
465 before asking DNS to resolve the fixed-adddress. LTSP will use
466 dhcphwaddress or associateddomain and the ldapconfig* attributes.
</p
>
468 <p
>I am not yet sure if I can get the DHCP server to look for its
469 dhcphost in a different location, to allow us to put the objects
470 outside the
"DHCP Config
" subtree, but hope to figure out a way to do
471 that. If I can
't figure out a way to do that, we can still get rid of
472 the hosts subtree and move all its content into the DHCP Config tree
473 (which probably should be renamed to be more related to the new
474 content. I suspect cn=dnsdhcp,ou=services or something like that
475 might be a good place to put it.
</p
>
477 <p
>If you want to help out with implementing this for Debian Edu,
478 please contact us on debian-edu@lists.debian.org.
</p
>
483 <title>Idea for storing LTSP configuration in LDAP
</title>
484 <link>http://people.skolelinux.org/pere/blog/Idea_for_storing_LTSP_configuration_in_LDAP.html
</link>
485 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Idea_for_storing_LTSP_configuration_in_LDAP.html
</guid>
486 <pubDate>Sun,
11 Jul
2010 22:
00:
00 +
0200</pubDate>
487 <description><p
>Vagrant mentioned on IRC today that ltsp_config now support
488 sourcing files from /usr/share/ltsp/ltsp_config.d/ on the thin
489 clients, and that this can be used to fetch configuration from LDAP if
490 Debian Edu choose to store configuration there.
</p
>
492 <p
>Armed with this information, I got inspired and wrote a test module
493 to get configuration from LDAP. The idea is to look up the MAC
494 address of the client in LDAP, and look for attributes on the form
495 ltspconfigsetting=value, and use this to export SETTING=value to the
496 LTSP clients.
</p
>
498 <p
>The goal is to be able to store the LTSP configuration attributes
499 in a
"computer
" LDAP object used by both DNS and DHCP, and thus
500 allowing us to store all information about a computer in one place.
</p
>
502 <p
>This is a untested draft implementation, and I welcome feedback on
503 this approach. A real LDAP schema for the ltspClientAux objectclass
504 need to be written. Comments, suggestions, etc?
</p
>
506 <blockquote
><pre
>
507 # Store in /opt/ltsp/$arch/usr/share/ltsp/ltsp_config.d/ldap-config
509 # Fetch LTSP client settings from LDAP based on MAC address
511 # Uses ethernet address as stored in the dhcpHost objectclass using
512 # the dhcpHWAddress attribute or ethernet address stored in the
513 # ieee802Device objectclass with the macAddress attribute.
515 # This module is written to be schema agnostic, and only depend on the
516 # existence of attribute names.
518 # The LTSP configuration variables are saved directly using a
519 # ltspConfig prefix and uppercasing the rest of the attribute name.
520 # To set the SERVER variable, set the ltspConfigServer attribute.
522 # Some LDAP schema should be created with all the relevant
523 # configuration settings. Something like this should work:
525 # objectclass (
1.1.2.2 NAME
'ltspClientAux
'
528 # MAY ( ltspConfigServer $ ltsConfigSound $ ... )
530 LDAPSERVER=$(debian-edu-ldapserver)
531 if [
"$LDAPSERVER
" ] ; then
532 LDAPBASE=$(debian-edu-ldapserver -b)
533 for MAC in $(LANG=C ifconfig |grep -i hwaddr| awk
'{print $
5}
'|sort -u) ; do
534 filter=
"(|(dhcpHWAddress=ethernet $MAC)(macAddress=$MAC))
"
535 ldapsearch -h
"$LDAPSERVER
" -b
"$LDAPBASE
" -v -x
"$filter
" | \
536 grep
'^ltspConfig
' | while read attr value ; do
537 # Remove prefix and convert to upper case
538 attr=$(echo $attr | sed
's/^ltspConfig//i
' | tr a-z A-Z)
539 # bass value on to clients
540 eval
"$attr=$value; export $attr
"
544 </pre
></blockquote
>
546 <p
>I
'm not sure this shell construction will work, because I suspect
547 the while block might end up in a subshell causing the variables set
548 there to not show up in ltsp-config, but if that is the case I am sure
549 the code can be restructured to make sure the variables are passed on.
550 I expect that can be solved with some testing. :)
</p
>
552 <p
>If you want to help out with implementing this for Debian Edu,
553 please contact us on debian-edu@lists.debian.org.
</p
>
555 <p
>Update
2010-
07-
17: I am aware of another effort to store LTSP
556 configuration in LDAP that was created around year
2000 by
557 <a href=
"http://www.pcxperience.com/thinclient/documentation/ldap.html
">PC
558 Xperience, Inc.,
2000</a
>. I found its
559 <a href=
"http://people.redhat.com/alikins/ltsp/ldap/
">files
</a
> on a
560 personal home page over at redhat.com.
</p
>
565 <title>jXplorer, a very nice LDAP GUI
</title>
566 <link>http://people.skolelinux.org/pere/blog/jXplorer__a_very_nice_LDAP_GUI.html
</link>
567 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/jXplorer__a_very_nice_LDAP_GUI.html
</guid>
568 <pubDate>Fri,
9 Jul
2010 12:
55:
00 +
0200</pubDate>
569 <description><p
>Since
570 <a href=
"http://people.skolelinux.org/pere/blog/LUMA__a_very_nice_LDAP_GUI.html
">my
571 last post
</a
> about available LDAP tools in Debian, I was told about a
572 LDAP GUI that is even better than luma. The java application
573 <a href=
"http://jxplorer.org/
">jXplorer
</a
> is claimed to be capable of
574 moving LDAP objects and subtrees using drag-and-drop, and can
575 authenticate using Kerberos. I have only tested the Kerberos
576 authentication, but do not have a LDAP setup allowing me to rewrite
577 LDAP with my test user yet. It is
578 <a href=
"http://packages.qa.debian.org/j/jxplorer.html
">available in
579 Debian
</a
> testing and unstable at the moment. The only problem I
580 have with it is how it handle errors. If something go wrong, its
581 non-intuitive behaviour require me to go through some query work list
582 and remove the failing query. Nothing big, but very annoying.
</p
>
587 <title>Caching password, user and group on a roaming Debian laptop
</title>
588 <link>http://people.skolelinux.org/pere/blog/Caching_password__user_and_group_on_a_roaming_Debian_laptop.html
</link>
589 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Caching_password__user_and_group_on_a_roaming_Debian_laptop.html
</guid>
590 <pubDate>Thu,
1 Jul
2010 11:
40:
00 +
0200</pubDate>
591 <description><p
>For a laptop, centralized user directories and password checking is
592 a bit troubling. Laptops are typically used also when not connected
593 to the network, and it is vital for a user to be able to log in or
594 unlock the screen saver also when a central server is unavailable.
595 This is possible by caching passwords and directory information (user
596 and group attributes) locally, and the packages to do so are available
597 in Debian. Here follow two recipes to set this up in Debian/Squeeze.
598 It is also possible to set up in Debian/Lenny, but require more manual
599 setup there because pam-auth-update is missing in Lenny.
</p
>
601 <h2
>LDAP/Kerberos + nscd + libpam-ccreds + libpam-mklocaluser/pam_mkhomedir
</h2
>
603 This is the traditional method with a twist. The password caching is
604 provided by libpam-ccreds (version
10-
4 or later is needed on
605 Squeeze), and the directory caching is done by nscd. The directory
606 lookup and password checking is done using LDAP. If one want to use
607 Kerberos for password checking the libpam-ldapd package can be
608 replaced with libpam-krb5 or libpam-heimdal. If one is happy having a
609 local home directory with the path listed in LDAP, one can use the
610 pam_mkhomedir module from pam-modules to make this happen instead of
611 using libpam-mklocaluser. A setup for pam-auth-update to enable
612 pam_mkhomedir will have to be written until a fix for
613 <a href=
"http://bugs.debian.org/
568577">bug #
568577</a
> is in the
614 archive. Because I believe it is a bad idea to have local home
615 directories using misleading paths like /site/server/partition/, I
616 prefer to create a local user with the home directory in /home/. This
617 is done using the libpam-mklocaluser package.
</p
>
619 <p
>These packages need to be installed and configured
</p
>
621 <blockquote
><pre
>
622 libnss-ldapd libpam-ldapd nscd libpam-ccreds libpam-mklocaluser
623 </pre
></blockquote
>
625 <p
>The ldapd packages will ask for LDAP connection information, and
626 one have to fill in the values that fits ones own site. Make sure the
627 PAM part uses encrypted connections, to make sure the password is not
628 sent in clear text to the LDAP server. I
've been unable to get TLS
629 certificate checking for a self signed certificate working, which make
630 LDAP authentication unsafe for Debian Edu (nslcd is not checking if it
631 is talking to the correct LDAP server), and very much welcome feedback
632 on how to get this working.
</p
>
634 <p
>Because nscd do not have a default configuration fit for offline
635 caching until
<a href=
"http://bugs.debian.org/
485282">bug #
485282</a
>
636 is fixed, this configuration should be used instead of the one
637 currently in /etc/nscd.conf. The changes are in the fields
638 reload-count and positive-time-to-live, and is based on the
639 instructions I found in the
640 <a href=
"http://www.flyn.org/laptopldap/
">LDAP for Mobile Laptops
</a
>
641 instructions by Flyn Computing.
</p
>
643 <blockquote
><pre
>
645 reload-count unlimited
648 enable-cache passwd yes
649 positive-time-to-live passwd
2592000
650 negative-time-to-live passwd
20
651 suggested-size passwd
211
652 check-files passwd yes
653 persistent passwd yes
655 max-db-size passwd
33554432
656 auto-propagate passwd yes
658 enable-cache group yes
659 positive-time-to-live group
2592000
660 negative-time-to-live group
20
661 suggested-size group
211
662 check-files group yes
665 max-db-size group
33554432
666 auto-propagate group yes
668 enable-cache hosts no
669 positive-time-to-live hosts
2592000
670 negative-time-to-live hosts
20
671 suggested-size hosts
211
672 check-files hosts yes
675 max-db-size hosts
33554432
677 enable-cache services yes
678 positive-time-to-live services
2592000
679 negative-time-to-live services
20
680 suggested-size services
211
681 check-files services yes
682 persistent services yes
684 max-db-size services
33554432
685 </pre
></blockquote
>
687 <p
>While we wait for a mechanism to update /etc/nsswitch.conf
688 automatically like the one provided in
689 <a href=
"http://bugs.debian.org/
496915">bug #
496915</a
>, the file
690 content need to be manually replaced to ensure LDAP is used as the
691 directory service on the machine. /etc/nsswitch.conf should normally
692 look like this:
</p
>
694 <blockquote
><pre
>
698 hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
705 </pre
></blockquote
>
707 <p
>The important parts are that ldap is listed last for passwd, group,
708 shadow and netgroup.
</p
>
710 <p
>With these changes in place, any user in LDAP will be able to log
711 in locally on the machine using for example kdm, get a local home
712 directory created and have the password as well as user and group
715 <h2
>LDAP/Kerberos + nss-updatedb + libpam-ccreds +
716 libpam-mklocaluser/pam_mkhomedir
</h2
>
718 <p
>Because nscd have had its share of problems, and seem to have
719 problems doing proper caching, I
've seen suggestions and recipes to
720 use nss-updatedb to copy parts of the LDAP database locally when the
721 LDAP database is available. I have not tested such setup, because I
722 discovered sssd.
</p
>
724 <h2
>LDAP/Kerberos + sssd + libpam-mklocaluser
</h2
>
726 <p
>A more flexible and robust setup than the nscd combination
727 mentioned earlier that has shown up recently, is the
728 <a href=
"https://fedorahosted.org/sssd/
">sssd
</a
> package from Redhat.
729 It is part of the
<a href=
"http://www.freeipa.org/
">FreeIPA
</A
> project
730 to provide a Active Directory like directory service for Linux
731 machines. The sssd system combines the caching of passwords and user
732 information into one package, and remove the need for nscd and
733 libpam-ccreds. It support LDAP and Kerberos, but not NIS. Version
734 1.2 do not support netgroups, but it is said that it will support this
735 in version
1.5 expected to show up later in
2010. Because the
736 <a href=
"http://packages.qa.debian.org/s/sssd.html
">sssd package
</a
>
737 was missing in Debian, I ended up co-maintaining it with Werner, and
738 version
1.2 is now in testing.
740 <p
>These packages need to be installed and configured to get the
741 roaming setup I want
</p
>
743 <blockquote
><pre
>
744 libpam-sss libnss-sss libpam-mklocaluser
745 </pre
></blockquote
>
747 The complete setup of sssd is done by editing/creating
748 <tt
>/etc/sssd/sssd.conf
</tt
>.
750 <blockquote
><pre
>
752 config_file_version =
2
753 reconnection_retries =
3
761 reconnection_retries =
3
764 reconnection_retries =
3
768 cache_credentials = true
772 chpass_provider = ldap
774 ldap_uri = ldap://ldap
775 ldap_search_base = dc=skole,dc=skolelinux,dc=no
776 ldap_tls_reqcert = never
777 ldap_tls_cacert = /etc/ssl/certs/ca-certificates.crt
778 </pre
></blockquote
>
780 <p
>I got the same problem here with certificate checking. Had to set
781 "ldap_tls_reqcert = never
" to get it working.
</p
>
783 <p
>With the libnss-sss package in testing at the moment, the
784 nsswitch.conf file is update automatically, so there is no need to
785 modify it manually.
</p
>
787 <p
>If you want to help out with implementing this for Debian Edu,
788 please contact us on debian-edu@lists.debian.org.
</p
>
793 <title>LUMA, a very nice LDAP GUI
</title>
794 <link>http://people.skolelinux.org/pere/blog/LUMA__a_very_nice_LDAP_GUI.html
</link>
795 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/LUMA__a_very_nice_LDAP_GUI.html
</guid>
796 <pubDate>Mon,
28 Jun
2010 00:
30:
00 +
0200</pubDate>
797 <description><p
>The last few days I have been looking into the status of the LDAP
798 directory in Debian Edu, and in the process I started to miss a GUI
799 tool to browse the LDAP tree. The only one I was able to find in
800 Debian/Squeeze and Lenny is
801 <a href=
"http://luma.sourceforge.net/
">LUMA
</a
>, which has proved to
802 be a great tool to get a overview of the current LDAP directory
803 populated by default in Skolelinux. Thanks to it, I have been able to
804 find empty and obsolete subtrees, misplaced objects and duplicate
805 objects. It will be installed by default in Debian/Squeeze. If you
806 are working with LDAP, give it a go. :)
</p
>
808 <p
>I did notice one problem with it I have not had time to report to
809 the BTS yet. There is no .desktop file in the package, so the tool do
810 not show up in the Gnome and KDE menus, but only deep down in in the
811 Debian submenu in KDE. I hope that can be fixed before Squeeze is
814 <p
>I have not yet been able to get it to modify the tree yet. I would
815 like to move objects and remove subtrees directly in the GUI, but have
816 not found a way to do that with LUMA yet. So in the mean time, I use
817 <a href=
"http://www.lichteblau.com/ldapvi/
">ldapvi
</a
> for that.
</p
>
819 <p
>If you have tips on other GUI tools for LDAP that might be useful
820 in Debian Edu, please contact us on debian-edu@lists.debian.org.
</p
>
822 <p
>Update
2010-
06-
29: Ross Reedstrom tipped us about the
823 <a href=
"http://packages.qa.debian.org/g/gq.html
">gq
</a
> package as a
824 useful GUI alternative. It seem like a good tool, but is unmaintained
825 in Debian and got a RC bug keeping it out of Squeeze. Unless that
826 changes, it will not be an option for Debian Edu based on Squeeze.
</p
>
831 <title>Idea for a change to LDAP schemas allowing DNS and DHCP info to be combined into one object
</title>
832 <link>http://people.skolelinux.org/pere/blog/Idea_for_a_change_to_LDAP_schemas_allowing_DNS_and_DHCP_info_to_be_combined_into_one_object.html
</link>
833 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Idea_for_a_change_to_LDAP_schemas_allowing_DNS_and_DHCP_info_to_be_combined_into_one_object.html
</guid>
834 <pubDate>Thu,
24 Jun
2010 00:
35:
00 +
0200</pubDate>
835 <description><p
>A while back, I
836 <a href=
"http://people.skolelinux.org/pere/blog/Time_for_new__LDAP_schemas_replacing_RFC_2307_.html
">complained
837 about the fact
</a
> that it is not possible with the provided schemas
838 for storing DNS and DHCP information in LDAP to combine the two sets
839 of information into one LDAP object representing a computer.
</p
>
841 <p
>In the mean time, I discovered that a simple fix would be to make
842 the dhcpHost object class auxiliary, to allow it to be combined with
843 the dNSDomain object class, and thus forming one object for one
844 computer when storing both DHCP and DNS information in LDAP.
</p
>
846 <p
>If I understand this correctly, it is not safe to do this change
847 without also changing the assigned number for the object class, and I
848 do not know enough about LDAP schema design to do that properly for
849 Debian Edu.
</p
>
851 <p
>Anyway, for future reference, this is how I believe we could change
853 <a href=
"http://tools.ietf.org/html/draft-ietf-dhc-ldap-schema-
00">DHCP
854 schema
</a
> to solve at least part of the problem with the LDAP schemas
855 available today from IETF.
</p
>
858 --- dhcp.schema (revision
65192)
859 +++ dhcp.schema (working copy)
861 objectclass (
2.16.840.1.113719.1.203.6.6
862 NAME
'dhcpHost
'
863 DESC
'This represents information about a particular client
'
867 MAY (dhcpLeaseDN $ dhcpHWAddress $ dhcpOptionsDN $ dhcpStatements $ dhcpComments $ dhcpOption)
868 X-NDS_CONTAINMENT (
'dhcpService
' 'dhcpSubnet
' 'dhcpGroup
') )
871 <p
>I very much welcome clues on how to do this properly for Debian
872 Edu/Squeeze. We provide the DHCP schema in our debian-edu-config
873 package, and should thus be free to rewrite it as we see fit.
</p
>
875 <p
>If you want to help out with implementing this for Debian Edu,
876 please contact us on debian-edu@lists.debian.org.
</p
>
881 <title>Time for new LDAP schemas replacing RFC
2307?
</title>
882 <link>http://people.skolelinux.org/pere/blog/Time_for_new__LDAP_schemas_replacing_RFC_2307_.html
</link>
883 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Time_for_new__LDAP_schemas_replacing_RFC_2307_.html
</guid>
884 <pubDate>Sun,
29 Mar
2009 20:
30:
00 +
0200</pubDate>
885 <description><p
>The state of standardized LDAP schemas on Linux is far from
886 optimal. There is RFC
2307 documenting one way to store NIS maps in
887 LDAP, and a modified version of this normally called RFC
2307bis, with
888 some modifications to be compatible with Active Directory. The RFC
889 specification handle the content of a lot of system databases, but do
890 not handle DNS zones and DHCP configuration.
</p
>
892 <p
>In
<a href=
"http://www.skolelinux.org/
">Debian Edu/Skolelinux
</a
>,
893 we would like to store information about users, SMB clients/hosts,
894 filegroups, netgroups (users and hosts), DHCP and DNS configuration,
895 and LTSP configuration in LDAP. These objects have a lot in common,
896 but with the current LDAP schemas it is not possible to have one
897 object per entity. For example, one need to have at least three LDAP
898 objects for a given computer, one with the SMB related stuff, one with
899 DNS information and another with DHCP information. The schemas
900 provided for DNS and DHCP are impossible to combine into one LDAP
901 object. In addition, it is impossible to implement quick queries for
902 netgroup membership, because of the way NIS triples are implemented.
903 It just do not scale. I believe it is time for a few RFC
904 specifications to cleam up this mess.
</p
>
906 <p
>I would like to have one LDAP object representing each computer in
907 the network, and this object can then keep the SMB (ie host key), DHCP
908 (mac address/name) and DNS (name/IP address) settings in one place.
909 It need to be efficently stored to make sure it scale well.
</p
>
911 <p
>I would also like to have a quick way to map from a user or
912 computer and to the net group this user or computer is a member.
</p
>
914 <p
>Active Directory have done a better job than unix heads like myself
915 in this regard, and the unix side need to catch up. Time to start a
916 new IETF work group?
</p
>