1 Title: Caching password, user and group on a roaming Debian laptop
2 Tags: english, nuug, debian edu
5 <p>For a laptop, centralized user directories and password checking is
6 a bit troubling. Laptops are typically used also when not connected
7 to the network, and it is vital for a user to be able to log in or
8 unlock the screen saver lock also when the central servers are
9 unavailable. This is possible by caching passwords and directory
10 information locally, and the packages to do so are available in
11 Debian. Here follow two recipes to set this up in Debian/Squeeze. It
12 is also possible to set up in Debian/Lenny, but require more manual
13 setup there because pam-auth-update is missing in Lenny.</p>
15 <p>If you want to help out with implementing this for Debian Edu,
16 please contact us on debian-edu@lists.debian.org.</p>
18 <h2>LDAP/Kerberos + nscd + libpam-ccreds + libpam-mklocaluser/pam_mkhomedir</h2>
20 This is the traditional method with a twist. The password caching is
21 provided by libpam-ccreds (version 10-4 or later, currently only in
22 experimental), and the directory caching is done by nscd. The
23 directory lookup and password checking is done using LDAP. If one
24 want to use Kerberos for password checking the libpam-ldapd package
25 can be replaced with for example libpam-krb5. If one is happy having
26 a local home directory with the path listed in LDAP, one can use
27 pam_mkhomedir to make this happen. A setup for pam-auth-update will
28 have to be written until a fix for
29 <a href="http://bugs.debian.org/568577">bug #568577</a> is in the
31 archive. Because I believe it is a bad idea to have local home
32 directories using misleading paths like /site/server/partition/, I
33 prefer to create a local user with the home directory in /home/
34 instead. This is done using the libpam-mklocaluser package entering
35 Squeeze in the next few days.</p>
37 <p>These packages need to be installed and configured</p>
40 libnss-ldapd libpam-ldapd nscd libpam-ccreds libpam-mklocaluser
43 Because nscd do not have a default configuration fit for offline
44 caching until <a href="http://bugs.debian.org/485282">bug #485282</a>
45 is fixed, this configuration should be used instead of the one
46 currently in /etc/nscd.conf. The changes are in the fields
47 reload-count and positive-time-to-live, and is based on the
48 instructions I found in the
49 <a href="http://www.flyn.org/laptopldap/">LDAP for Mobile Laptops</a>
50 instructions by Flyn Computing.
54 reload-count unlimited
57 enable-cache passwd yes
58 positive-time-to-live passwd 2592000
59 negative-time-to-live passwd 20
60 suggested-size passwd 211
61 check-files passwd yes
64 max-db-size passwd 33554432
65 auto-propagate passwd yes
67 enable-cache group yes
68 positive-time-to-live group 2592000
69 negative-time-to-live group 20
70 suggested-size group 211
74 max-db-size group 33554432
75 auto-propagate group yes
78 positive-time-to-live hosts 2592000
79 negative-time-to-live hosts 20
80 suggested-size hosts 211
84 max-db-size hosts 33554432
86 enable-cache services yes
87 positive-time-to-live services 2592000
88 negative-time-to-live services 20
89 suggested-size services 211
90 check-files services yes
91 persistent services yes
93 max-db-size services 33554432
96 <p>While we wait for the mechanism to update /etc/nsswitch.conf
97 automatically provided in <a href="http://bugs.debian.org/496915">bug
98 #496915</a>, it need to be replaced manually to ensure LDAP is used as
99 the directory. /etc/nsswitch.conf should look like this:</p>
105 hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
114 <h2>LDAP/Kerberos + sssd + libpam-mklocaluser/pam_mkhomedir</h2>
116 <p>These packages need to be installed and configured</p>
119 libpam-sss libnss-sss libpam-mklocaluser
126 config_file_version = 2
127 reconnection_retries = 3
135 reconnection_retries = 3
138 reconnection_retries = 3
142 cache_credentials = true
146 chpass_provider = ldap
148 ldap_uri = ldap://ldap.uio.no
149 ldap_search_base = cn=system,dc=uio,dc=no
150 ldap_tls_reqcert = never
151 ldap_tls_cacert = /etc/ssl/certs/ca-certificates.crt