1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" dir=
"ltr">
5 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8" />
6 <title>Petter Reinholdtsen: No hardcoded config on Debian Edu clients
</title>
7 <link rel=
"stylesheet" type=
"text/css" media=
"screen" href=
"http://people.skolelinux.org/pere/blog/style.css" />
8 <link rel=
"stylesheet" type=
"text/css" media=
"screen" href=
"http://people.skolelinux.org/pere/blog/vim.css" />
13 <a href=
"http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen
</a>
21 <div class=
"title">No hardcoded config on Debian Edu clients
</div>
22 <div class=
"date"> 9th August
2010</div>
23 <div class=
"body"><p>As reported earlier, the last few days I have looked at how Debian
24 Edu clients are configured, and tried to get rid of all hardcoded
25 configuration settings on the clients. I believe the work to be
26 mostly done, and the clients seem to work just fine with dynamically
27 generated configuration.
</p>
29 <p>What is the point, you might ask? The point is to allow a Debian
30 Edu desktop to integrate into an existing network infrastructure
31 without any manual configuration.
</p>
33 <p>This is what happens when installing a Debian Edu client here at
34 the University of Oslo using PXE. With the PXE installation, I am
35 asked for language (Norwegian Bokmål), locality (Norway) and keyboard
36 layout (no-latin1), Debian Edu profile (Roaming Workstation), if I
37 accept to reformat the hard drive (yes), if I want to submit info to
38 popcon.debian.org (no) and root password (secret). After answering
39 these questions, the installer goes ahead and does its thing, and
40 after around
50 minutes it is done. I press enter to finish the
41 installation, and the machine reboots into KDE. When the machine is
42 ready and kdm asks for login information, I enter my university
43 username and password, am told by kdm that a local home directory has
44 been created and that I must log in again, and finally log in with the
45 same username and password to the KDE
4.4 desktop. At no point during
46 this process did it ask for university specific settings, and all the
47 required configuration was dynamically detected using information
48 fetched via DHCP and DNS. The roaming workstation is now ready for
51 <p>How was this done, you might wonder? First of all, here is the
52 list of things that need to be configured on the client to get it
53 working properly out of the box:
</p>
56 <li>IP address/netmask and DNS server.
</li>
57 <li>Web proxy URL.
</li>
58 <li>LDAP server for NSS directory information (user, group, etc).
</li>
59 <li>Kerberos server for PAM password checking.
</li>
60 <li>SMB mount point to access the network home directory. (*)
</li>
61 <li>Central syslog server to send syslog messages to. (*)
</li>
62 <li>Sitesummary collector URL to submit info to central server. (*)
</li>
65 <p>(Hm, did I forget anything? Let me knew if I did.)
</p>
67 <p>The points marked (*) are not required to be able to use the
68 machine, but needed to provide central storage and allowing system
69 administrators to track their machines. Since yesterday, everything
70 but the sitesummary collector URL is dynamically discovered at boot
71 and installation time in the svn version of Debian Edu.
</p>
73 <p>The IP and DNS setup is fetched during boot using DHCP as usual.
74 When a DHCP update arrives, the proxy setup is updated by looking for
75 http://wpat/wpad.dat and using the content of this WPAD file to
76 configure the http and ftp proxy in /etc/environment and
77 /etc/apt/apt.conf. I decided to update the proxy setup using a DHCP
78 hook to ensure that the client stops using the Debian Edu proxy when
79 it is moved outside the Debian Edu network, and instead uses any local
80 proxy present on the new network when it moves around.
</p>
82 <p>The DNS names of the LDAP, Kerberos and syslog server and related
83 configuration are generated using DNS information at boot. First the
84 installer looks for a host named ldap in the current DNS domain. If
85 not found, it looks for _ldap._tcp SRV records in DNS instead. If an
86 LDAP server is found, its root DSE entry is requested and the
87 attributes namingContexts and defaultNamingContext are used to
88 determine which LDAP base to use for NSS. If there are several
89 namingContexts attibutes and the defaultNamingContext is present, that
90 LDAP subtree is used as the base. If defaultNamingContext is missing,
91 the subtrees listed as namingContexts are searched in sequence for any
92 object with class posixAccount or posixGroup, and the first one with
93 such an object is used as the LDAP base. For Kerberos, a similar
94 search is done by first looking for a host named kerberos, and then
95 for the _kerberos._tcp SRV record. I've been unable to find a way to
96 look up the Kerberos realm, so for this the upper case string of the
97 current DNS domain is used.
</p>
99 <p>For the syslog server, the hosts syslog and loghost are searched
100 for, and the _syslog._udp SRV record is consulted if no such host is
101 found. This algorithm works for both Debian Edu and the University of
102 Oslo. A similar strategy would work for locating the sitesummary
103 server, but have not been implemented yet. I decided to fetch and
104 save these settings during installation, to make sure moving to a
105 different network does not change the set of users being allowed to
106 log in nor the passwords required to log in. Usernames and passwords
107 will be cached by sssd when the user logs in on the Debian Edu
108 network, and will not change as the laptop move around. For a
109 non-roaming machine, there is no caching, but given that it is
110 supposed to stay in place it should not matter much. Perhaps we
111 should switch those to use sssd too?
</p>
113 <p>The user's SMB mount point for the network home directory is
114 located when the user logs in for the first time. The LDAP server is
115 consulted to look for the user's LDAP object and the sambaHomePath
116 attribute is used if found. If it isn't found, the home directory
117 path fetched from NSS is used instead. Assuming the path is of the
118 form /site/server/directory/username, the second part is looked up in
119 DNS and used to generate a SMB URL of the form
120 smb://server.domain/username. This algorithm works for both Debian
121 edu and the University of Oslo. Perhaps there are better attributes
122 to use or a better algorithm that works for more sites, but this will
125 <p>This work should make it easier to integrate the Debian Edu clients
126 into any LDAP/Kerberos infrastructure, and make the current setup even
127 more flexible than before. I suspect it will also work for thin
128 client servers, allowing one to easily set up LTSP and hook it into a
129 existing network infrastructure, but I have not had time to test this
132 <p>If you want to help out with implementing these things for Debian
133 Edu, please contact us on debian-edu@lists.debian.org.
</p>
135 <p>Update
2010-
08-
09: Simon Farnsworth gave me a heads-up on how to
136 detect Kerberos realm from DNS, by looking for _kerberos TXT entries
137 before falling back to the upper case DNS domain name. Will have to
138 implement it for Debian Edu. :)
</p>
141 <div class=
"tags">Tags:
<a href=
"http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/english">english
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/nuug">nuug
</a>.
</div>
159 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/01/">January (
7)
</a></li>
161 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/02/">February (
10)
</a></li>
163 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/03/">March (
17)
</a></li>
165 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/04/">April (
12)
</a></li>
167 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/05/">May (
12)
</a></li>
169 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/06/">June (
20)
</a></li>
171 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/07/">July (
17)
</a></li>
173 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/08/">August (
6)
</a></li>
175 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/09/">September (
9)
</a></li>
177 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/10/">October (
5)
</a></li>
184 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/01/">January (
16)
</a></li>
186 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/02/">February (
6)
</a></li>
188 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/03/">March (
6)
</a></li>
190 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/04/">April (
7)
</a></li>
192 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/05/">May (
3)
</a></li>
194 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/06/">June (
2)
</a></li>
196 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/07/">July (
7)
</a></li>
198 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/08/">August (
6)
</a></li>
200 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/09/">September (
4)
</a></li>
202 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/10/">October (
2)
</a></li>
204 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/11/">November (
3)
</a></li>
206 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/12/">December (
1)
</a></li>
213 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/01/">January (
2)
</a></li>
215 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/02/">February (
1)
</a></li>
217 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/03/">March (
3)
</a></li>
219 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/04/">April (
3)
</a></li>
221 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/05/">May (
9)
</a></li>
223 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/06/">June (
14)
</a></li>
225 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/07/">July (
12)
</a></li>
227 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/08/">August (
13)
</a></li>
229 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/09/">September (
7)
</a></li>
231 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/10/">October (
9)
</a></li>
233 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/11/">November (
13)
</a></li>
235 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/12/">December (
12)
</a></li>
242 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/01/">January (
8)
</a></li>
244 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/02/">February (
8)
</a></li>
246 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/03/">March (
12)
</a></li>
248 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/04/">April (
10)
</a></li>
250 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/05/">May (
9)
</a></li>
252 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/06/">June (
3)
</a></li>
254 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/07/">July (
4)
</a></li>
256 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/08/">August (
3)
</a></li>
258 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/09/">September (
1)
</a></li>
260 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/10/">October (
2)
</a></li>
262 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/11/">November (
3)
</a></li>
264 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/12/">December (
3)
</a></li>
271 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/11/">November (
5)
</a></li>
273 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/12/">December (
7)
</a></li>
284 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (
13)
</a></li>
286 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/amiga">amiga (
1)
</a></li>
288 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/aros">aros (
1)
</a></li>
290 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin (
2)
</a></li>
292 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (
12)
</a></li>
294 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bsa">bsa (
2)
</a></li>
296 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian">debian (
57)
</a></li>
298 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (
113)
</a></li>
300 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/digistan">digistan (
9)
</a></li>
302 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/docbook">docbook (
7)
</a></li>
304 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/drivstoffpriser">drivstoffpriser (
4)
</a></li>
306 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/english">english (
153)
</a></li>
308 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (
18)
</a></li>
310 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (
12)
</a></li>
312 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/freeculture">freeculture (
8)
</a></li>
314 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/frikanalen">frikanalen (
8)
</a></li>
316 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/intervju">intervju (
31)
</a></li>
318 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/kart">kart (
17)
</a></li>
320 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ldap">ldap (
8)
</a></li>
322 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/lenker">lenker (
4)
</a></li>
324 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (
1)
</a></li>
326 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (
25)
</a></li>
328 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/norsk">norsk (
201)
</a></li>
330 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/nuug">nuug (
145)
</a></li>
332 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/offentlig innsyn">offentlig innsyn (
5)
</a></li>
334 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/open311">open311 (
2)
</a></li>
336 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (
35)
</a></li>
338 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/personvern">personvern (
49)
</a></li>
340 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/raid">raid (
1)
</a></li>
342 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/reprap">reprap (
11)
</a></li>
344 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rfid">rfid (
2)
</a></li>
346 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/robot">robot (
4)
</a></li>
348 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rss">rss (
1)
</a></li>
350 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ruter">ruter (
4)
</a></li>
352 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/scraperwiki">scraperwiki (
2)
</a></li>
354 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (
23)
</a></li>
356 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (
4)
</a></li>
358 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/skepsis">skepsis (
2)
</a></li>
360 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/standard">standard (
38)
</a></li>
362 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (
2)
</a></li>
364 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stortinget">stortinget (
4)
</a></li>
366 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance (
10)
</a></li>
368 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/valg">valg (
7)
</a></li>
370 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/video">video (
34)
</a></li>
372 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (
3)
</a></li>
374 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/web">web (
25)
</a></li>
380 <p style=
"text-align: right">
381 Created by
<a href=
"http://steve.org.uk/Software/chronicle">Chronicle v4.4
</a>