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