1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <title>Petter Reinholdtsen: entries from July
2010</title>
6 <link rel=
"stylesheet" type=
"text/css" media=
"screen" href=
"http://people.skolelinux.org/pere/blog/style.css">
7 <link rel=
"alternate" title=
"RSS Feed" href=
"07.rss" type=
"application/rss+xml">
14 <a href=
"http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen
</a>
20 <p>Entries from July
2010.
</p>
25 <a href=
"http://people.skolelinux.org/pere/blog/Caching_password__user_and_group_on_a_roaming_Debian_laptop.html">Caching password, user and group on a roaming Debian laptop
</a>
33 <p>For a laptop, centralized user directories and password checking is
34 a bit troubling. Laptops are typically used also when not connected
35 to the network, and it is vital for a user to be able to log in or
36 unlock the screen saver also when a central server is unavailable.
37 This is possible by caching passwords and directory information (user
38 and group attributes) locally, and the packages to do so are available
39 in Debian. Here follow two recipes to set this up in Debian/Squeeze.
40 It is also possible to set up in Debian/Lenny, but require more manual
41 setup there because pam-auth-update is missing in Lenny.
</p>
43 <h2>LDAP/Kerberos + nscd + libpam-ccreds + libpam-mklocaluser/pam_mkhomedir
</h2>
45 This is the traditional method with a twist. The password caching is
46 provided by libpam-ccreds (version
10-
4 or later is needed on
47 Squeeze), and the directory caching is done by nscd. The directory
48 lookup and password checking is done using LDAP. If one want to use
49 Kerberos for password checking the libpam-ldapd package can be
50 replaced with libpam-krb5 or libpam-heimdal. If one is happy having a
51 local home directory with the path listed in LDAP, one can use the
52 pam_mkhomedir module from pam-modules to make this happen instead of
53 using libpam-mklocaluser. A setup for pam-auth-update to enable
54 pam_mkhomedir will have to be written until a fix for
55 <a href=
"http://bugs.debian.org/568577">bug #
568577</a> is in the
56 archive. Because I believe it is a bad idea to have local home
57 directories using misleading paths like /site/server/partition/, I
58 prefer to create a local user with the home directory in /home/. This
59 is done using the libpam-mklocaluser package.
</p>
61 <p>These packages need to be installed and configured
</p>
64 libnss-ldapd libpam-ldapd nscd libpam-ccreds libpam-mklocaluser
67 <p>The ldapd packages will ask for LDAP connection information, and
68 one have to fill in the values that fits ones own site. Make sure the
69 PAM part uses encrypted connections, to make sure the password is not
70 sent in clear text to the LDAP server. I've been unable to get TLS
71 certificate checking for a self signed certificate working, which make
72 LDAP authentication unsafe for Debian Edu (nslcd is not checking if it
73 is talking to the correct LDAP server), and very much welcome feedback
74 on how to get this working.
</p>
76 <p>Because nscd do not have a default configuration fit for offline
77 caching until
<a href=
"http://bugs.debian.org/485282">bug #
485282</a>
78 is fixed, this configuration should be used instead of the one
79 currently in /etc/nscd.conf. The changes are in the fields
80 reload-count and positive-time-to-live, and is based on the
81 instructions I found in the
82 <a href=
"http://www.flyn.org/laptopldap/">LDAP for Mobile Laptops
</a>
83 instructions by Flyn Computing.
</p>
87 reload-count unlimited
90 enable-cache passwd yes
91 positive-time-to-live passwd
2592000
92 negative-time-to-live passwd
20
93 suggested-size passwd
211
94 check-files passwd yes
97 max-db-size passwd
33554432
98 auto-propagate passwd yes
100 enable-cache group yes
101 positive-time-to-live group
2592000
102 negative-time-to-live group
20
103 suggested-size group
211
104 check-files group yes
107 max-db-size group
33554432
108 auto-propagate group yes
110 enable-cache hosts no
111 positive-time-to-live hosts
2592000
112 negative-time-to-live hosts
20
113 suggested-size hosts
211
114 check-files hosts yes
117 max-db-size hosts
33554432
119 enable-cache services yes
120 positive-time-to-live services
2592000
121 negative-time-to-live services
20
122 suggested-size services
211
123 check-files services yes
124 persistent services yes
126 max-db-size services
33554432
129 <p>While we wait for a mechanism to update /etc/nsswitch.conf
130 automatically like the one provided in
131 <a href=
"http://bugs.debian.org/496915">bug #
496915</a>, the file
132 content need to be manually replaced to ensure LDAP is used as the
133 directory service on the machine. /etc/nsswitch.conf should normally
140 hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
149 <p>The important parts are that ldap is listed last for passwd, group,
150 shadow and netgroup.
</p>
152 <p>With these changes in place, any user in LDAP will be able to log
153 in locally on the machine using for example kdm, get a local home
154 directory created and have the password as well as user and group
157 <h2>LDAP/Kerberos + nss-updatedb + libpam-ccreds +
158 libpam-mklocaluser/pam_mkhomedir
</h2>
160 <p>Because nscd have had its share of problems, and seem to have
161 problems doing proper caching, I've seen suggestions and recipes to
162 use nss-updatedb to copy parts of the LDAP database locally when the
163 LDAP database is available. I have not tested such setup, because I
166 <h2>LDAP/Kerberos + sssd + libpam-mklocaluser
</h2>
168 <p>A more flexible and robust setup than the nscd combination
169 mentioned earlier that has shown up recently, is the
170 <a href=
"https://fedorahosted.org/sssd/">sssd
</a> package from Redhat.
171 It is part of the
<a href=
"http://www.freeipa.org/">FreeIPA
</A> project
172 to provide a Active Directory like directory service for Linux
173 machines. The sssd system combines the caching of passwords and user
174 information into one package, and remove the need for nscd and
175 libpam-ccreds. It support LDAP and Kerberos, but not NIS. Version
176 1.2 do not support netgroups, but it is said that it will support this
177 in version
1.5 expected to show up later in
2010. Because the
178 <a href=
"http://packages.qa.debian.org/s/sssd.html">sssd package
</a>
179 was missing in Debian, I ended up co-maintaining it with Werner, and
180 version
1.2 is now in testing.
182 <p>These packages need to be installed and configured to get the
183 roaming setup I want
</p>
186 libpam-sss libnss-sss libpam-mklocaluser
189 The complete setup of sssd is done by editing/creating
190 <tt>/etc/sssd/sssd.conf
</tt>.
194 config_file_version =
2
195 reconnection_retries =
3
203 reconnection_retries =
3
206 reconnection_retries =
3
210 cache_credentials = true
214 chpass_provider = ldap
216 ldap_uri = ldap://ldap
217 ldap_search_base = dc=skole,dc=skolelinux,dc=no
218 ldap_tls_reqcert = never
219 ldap_tls_cacert = /etc/ssl/certs/ca-certificates.crt
222 <p>I got the same problem here with certificate checking. Had to set
223 "ldap_tls_reqcert = never" to get it working.
</p>
225 <p>With the libnss-sss package in testing at the moment, the
226 nsswitch.conf file is update automatically, so there is no need to
227 modify it manually.
</p>
229 <p>If you want to help out with implementing this for Debian Edu,
230 please contact us on debian-edu@lists.debian.org.
</p>
237 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/ldap">ldap
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/nuug">nuug
</a>.
241 <div class=
"padding"></div>
243 <p style=
"text-align: right;"><a href=
"07.rss"><img src=
"http://people.skolelinux.org/pere/blog/xml.gif" alt=
"RSS Feed" width=
"36" height=
"14"></a></p>
255 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/01/">January (
2)
</a></li>
257 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/02/">February (
1)
</a></li>
259 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/03/">March (
3)
</a></li>
261 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/04/">April (
3)
</a></li>
263 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/05/">May (
9)
</a></li>
265 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/06/">June (
14)
</a></li>
267 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/07/">July (
1)
</a></li>
274 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/01/">January (
8)
</a></li>
276 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/02/">February (
8)
</a></li>
278 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/03/">March (
12)
</a></li>
280 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/04/">April (
10)
</a></li>
282 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/05/">May (
9)
</a></li>
284 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/06/">June (
3)
</a></li>
286 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/07/">July (
4)
</a></li>
288 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/08/">August (
3)
</a></li>
290 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/09/">September (
1)
</a></li>
292 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/10/">October (
2)
</a></li>
294 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/11/">November (
3)
</a></li>
296 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/12/">December (
3)
</a></li>
303 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/11/">November (
5)
</a></li>
305 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/12/">December (
7)
</a></li>
316 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (
11)
</a></li>
318 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/amiga">amiga (
1)
</a></li>
320 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/aros">aros (
1)
</a></li>
322 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (
10)
</a></li>
324 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian">debian (
29)
</a></li>
326 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (
29)
</a></li>
328 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/english">english (
42)
</a></li>
330 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (
1)
</a></li>
332 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (
7)
</a></li>
334 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/kart">kart (
2)
</a></li>
336 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ldap">ldap (
4)
</a></li>
338 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/lenker">lenker (
1)
</a></li>
340 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (
1)
</a></li>
342 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (
5)
</a></li>
344 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/norsk">norsk (
69)
</a></li>
346 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/nuug">nuug (
80)
</a></li>
348 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (
13)
</a></li>
350 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/personvern">personvern (
13)
</a></li>
352 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/reprap">reprap (
10)
</a></li>
354 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rss">rss (
1)
</a></li>
356 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (
9)
</a></li>
358 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (
3)
</a></li>
360 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/standard">standard (
13)
</a></li>
362 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (
1)
</a></li>
364 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/video">video (
10)
</a></li>
366 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (
1)
</a></li>
368 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/web">web (
6)
</a></li>