]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2010/05/index.html
Generated.
[homepage.git] / blog / archive / 2010 / 05 / index.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5 <title>Petter Reinholdtsen: entries from May 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="05.rss" type="application/rss+xml">
8 </head>
9 <body>
10 <!-- XML FEED -->
11
12 <div class="title">
13 <h1>
14 <a href="http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen</a>
15
16 </h1>
17
18 </div>
19
20 <p>Entries from May 2010.</p>
21
22
23 <div class="entry">
24 <div class="title">
25 <a href="http://people.skolelinux.org/pere/blog/Forcing_new_users_to_change_their_password_on_first_login.html">Forcing new users to change their password on first login</a>
26 </div>
27 <div class="date">
28 2010-05-02 13:47
29 </div>
30
31 <div class="body">
32
33 <p>One interesting feature in Active Directory, is the ability to
34 create a new user with an expired password, and thus force the user to
35 change the password on the first login attempt.</p>
36
37 <p>I'm not quite sure how to do that with the LDAP setup in Debian
38 Edu, but did some initial testing with a local account. The account
39 and password aging information is available in /etc/shadow, but
40 unfortunately, it is not possible to specify an expiration time for
41 passwords, only a maximum age for passwords.</p>
42
43 <p>A freshly created account (using adduser test) will have these
44 settings in /etc/shadow:</p>
45
46 <blockquote><pre>
47 root@tjener:~# chage -l test
48 Last password change : May 02, 2010
49 Password expires : never
50 Password inactive : never
51 Account expires : never
52 Minimum number of days between password change : 0
53 Maximum number of days between password change : 99999
54 Number of days of warning before password expires : 7
55 root@tjener:~#
56 </pre></blockquote>
57
58 <p>The only way I could come up with to create a user with an expired
59 account, is to change the date of the last password change to the
60 lowest value possible (January 1th 1970), and the maximum password age
61 to the difference in days between that date and today. To make it
62 simple, I went for 30 years (30 * 365 = 10950) and January 2th (to
63 avoid testing if 0 is a valid value).</p>
64
65 <p>After using these commands to set it up, it seem to work as
66 intended:</p>
67
68 <blockquote><pre>
69 root@tjener:~# chage -d 1 test; chage -M 10950 test
70 root@tjener:~# chage -l test
71 Last password change : Jan 02, 1970
72 Password expires : never
73 Password inactive : never
74 Account expires : never
75 Minimum number of days between password change : 0
76 Maximum number of days between password change : 10950
77 Number of days of warning before password expires : 7
78 root@tjener:~#
79 </pre></blockquote>
80
81 <p>So far I have tested this with ssh and console, and kdm (in
82 Squeeze) login, and all ask for a new password before login in the
83 user (with ssh, I was thrown out and had to log in again).</p>
84
85 <p>Perhaps we should set up something similar for Debian Edu, to make
86 sure only the user itself have the account password?</p>
87
88 <p>If you want to comment on or help out with implementing this for
89 Debian Edu, please contact us on debian-edu@lists.debian.org.</p>
90
91 <p>Update 2010-05-02 17:20: Paul Tötterman tells me on IRC that the
92 shadow(8) page in Debian/testing now state that setting the date of
93 last password change to zero (0) will force the password to be changed
94 on the first login. This was not mentioned in the manual in Lenny, so
95 I did not notice this in my initial testing. I have tested it on
96 Squeeze, and '<tt>chage -d 0 username</tt>' do work there. I have not
97 tested it on Lenny yet.</p>
98
99 <p>Update 2010-05-02-19:05: Jim Paris tells me via email that an
100 equivalent command to expire a password is '<tt>passwd -e
101 username</tt>', which insert zero into the date of the last password
102 change.</p>
103
104 </div>
105 <div class="tags">
106
107
108
109 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>, <a href="http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet</a>.
110
111 </div>
112 </div>
113 <div class="padding"></div>
114
115 <p style="text-align: right;"><a href="05.rss"><img src="http://people.skolelinux.org/pere/blog/xml.gif" alt="RSS Feed" width="36" height="14"></a></p>
116
117
118
119 <div id="sidebar">
120
121 <h2>Archive</h2>
122 <ul>
123
124 <li>2010
125 <ul>
126
127 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/01/">January (2)</a></li>
128
129 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/02/">February (1)</a></li>
130
131 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/03/">March (3)</a></li>
132
133 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/04/">April (3)</a></li>
134
135 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/05/">May (1)</a></li>
136
137 </ul></li>
138
139 <li>2009
140 <ul>
141
142 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/01/">January (8)</a></li>
143
144 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/02/">February (8)</a></li>
145
146 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/03/">March (12)</a></li>
147
148 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/04/">April (10)</a></li>
149
150 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/05/">May (9)</a></li>
151
152 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/06/">June (3)</a></li>
153
154 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/07/">July (4)</a></li>
155
156 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/08/">August (3)</a></li>
157
158 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/09/">September (1)</a></li>
159
160 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/10/">October (2)</a></li>
161
162 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/11/">November (3)</a></li>
163
164 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/12/">December (3)</a></li>
165
166 </ul></li>
167
168 <li>2008
169 <ul>
170
171 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/11/">November (5)</a></li>
172
173 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/12/">December (7)</a></li>
174
175 </ul></li>
176
177 </ul>
178
179
180
181 <h2>Tags</h2>
182 <ul>
183
184 <li><a href="http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (11)</a></li>
185
186 <li><a href="http://people.skolelinux.org/pere/blog/tags/amiga">amiga (1)</a></li>
187
188 <li><a href="http://people.skolelinux.org/pere/blog/tags/aros">aros (1)</a></li>
189
190 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (14)</a></li>
191
192 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (15)</a></li>
193
194 <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (24)</a></li>
195
196 <li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (1)</a></li>
197
198 <li><a href="http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (6)</a></li>
199
200 <li><a href="http://people.skolelinux.org/pere/blog/tags/kart">kart (2)</a></li>
201
202 <li><a href="http://people.skolelinux.org/pere/blog/tags/lenker">lenker (1)</a></li>
203
204 <li><a href="http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (1)</a></li>
205
206 <li><a href="http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (5)</a></li>
207
208 <li><a href="http://people.skolelinux.org/pere/blog/tags/norsk">norsk (64)</a></li>
209
210 <li><a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug (71)</a></li>
211
212 <li><a href="http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (12)</a></li>
213
214 <li><a href="http://people.skolelinux.org/pere/blog/tags/personvern">personvern (11)</a></li>
215
216 <li><a href="http://people.skolelinux.org/pere/blog/tags/reprap">reprap (10)</a></li>
217
218 <li><a href="http://people.skolelinux.org/pere/blog/tags/rss">rss (1)</a></li>
219
220 <li><a href="http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (7)</a></li>
221
222 <li><a href="http://people.skolelinux.org/pere/blog/tags/standard">standard (11)</a></li>
223
224 <li><a href="http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (1)</a></li>
225
226 <li><a href="http://people.skolelinux.org/pere/blog/tags/video">video (10)</a></li>
227
228 <li><a href="http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (1)</a></li>
229
230 <li><a href="http://people.skolelinux.org/pere/blog/tags/web">web (6)</a></li>
231
232 </ul>
233
234 </div>
235 </body>
236 </html>