1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 1990 - 1994, Julianne Frances Haugh
4 Copyright (c) 2007 - 2011, Nicolas François
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. The name of the copyright holders or contributors may not be used to
16 endorse or promote products derived from this software without
17 specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
32 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
33 <!ENTITY USE_TCB SYSTEM "login.defs.d/USE_TCB.xml">
34 <!-- SHADOW-CONFIG-HERE -->
36 <refentry id='chage.1'>
40 <firstname>Julianne Frances</firstname>
41 <surname>Haugh</surname>
42 <contrib>Creation, 1990</contrib>
45 <firstname>Thomas</firstname>
46 <surname>Kłoczko</surname>
47 <email>kloczek@pld.org.pl</email>
48 <contrib>shadow-utils maintainer, 2000 - 2007</contrib>
51 <firstname>Nicolas</firstname>
52 <surname>François</surname>
53 <email>nicolas.francois@centraliens.net</email>
54 <contrib>shadow-utils maintainer, 2007 - now</contrib>
58 <refentrytitle>chage</refentrytitle>
59 <manvolnum>1</manvolnum>
60 <refmiscinfo class="sectdesc">User Commands</refmiscinfo>
61 <refmiscinfo class="source">shadow-utils</refmiscinfo>
62 <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
64 <refnamediv id='name'>
65 <refname>chage</refname>
66 <refpurpose>change user password expiry information</refpurpose>
68 <refsynopsisdiv id='synopsis'>
70 <command>chage</command>
72 <replaceable>options</replaceable>
75 <replaceable>LOGIN</replaceable>
80 <refsect1 id='description'>
81 <title>DESCRIPTION</title>
83 The <command>chage</command> command changes the number of days between
84 password changes and the date of the last password change. This
85 information is used by the system to determine when a user must change
90 <refsect1 id='options'>
91 <title>OPTIONS</title>
93 The options which apply to the <command>chage</command> command are:
95 <variablelist remap='IP'>
98 <option>-d</option>, <option>--lastday</option> <replaceable>LAST_DAY</replaceable>
102 Set the number of days since January 1st, 1970 when the password
103 was last changed. The date may also be expressed in the format
104 YYYY-MM-DD (or the format more commonly used in your area).
110 <option>-E</option>, <option>--expiredate</option> <replaceable>EXPIRE_DATE</replaceable>
114 Set the date or number of days since January 1, 1970 on which the
115 user's account will no longer be accessible. The date may also
116 be expressed in the format YYYY-MM-DD (or the format more
117 commonly used in your area). A user whose account is locked must
118 contact the system administrator before being able to use the
122 Passing the number <emphasis remap='I'>-1</emphasis> as the
123 <replaceable>EXPIRE_DATE</replaceable> will remove an account
129 <term><option>-h</option>, <option>--help</option></term>
131 <para>Display help message and exit.</para>
135 <term><option>-i</option>, <option>--iso8601</option></term>
137 <para>When printing dates, use YYYY-MM-DD format.</para>
142 <option>-I</option>, <option>--inactive</option> <replaceable>INACTIVE</replaceable>
146 Set the number of days of inactivity after a password has
147 expired before the account is locked. The
148 <replaceable>INACTIVE</replaceable> option is the number of days
149 of inactivity. A user whose account is locked must contact the
150 system administrator before being able to use the system again.
153 Passing the number <emphasis remap='I'>-1</emphasis> as the
154 <replaceable>INACTIVE</replaceable> will remove an account's
161 <option>-l</option>, <option>--list</option>
165 Show account aging information.
171 <option>-m</option>, <option>--mindays</option> <replaceable>MIN_DAYS</replaceable>
175 Set the minimum number of days between password changes to
176 <replaceable>MIN_DAYS</replaceable>. A value of zero for this field
177 indicates that the user may change their password at any time.
183 <option>-M</option>, <option>--maxdays</option> <replaceable>MAX_DAYS</replaceable>
187 Set the maximum number of days during which a password is valid.
188 When <replaceable>MAX_DAYS</replaceable> plus
189 <replaceable>LAST_DAY</replaceable> is less than the current
190 day, the user will be required to change their password before
191 being able to use their account. This occurrence can be planned for
192 in advance by use of the <option>-W</option> option, which
193 provides the user with advance warning.
196 Passing the number <emphasis remap='I'>-1</emphasis> as
197 <replaceable>MAX_DAYS</replaceable> will remove checking a
204 <option>-R</option>, <option>--root</option> <replaceable>CHROOT_DIR</replaceable>
208 Apply changes in the <replaceable>CHROOT_DIR</replaceable>
209 directory and use the configuration files from the
210 <replaceable>CHROOT_DIR</replaceable> directory.
216 <option>-W</option>, <option>--warndays</option> <replaceable>WARN_DAYS</replaceable>
220 Set the number of days of warning before a password change is
221 required. The <replaceable>WARN_DAYS</replaceable> option is the
222 number of days prior to the password expiring that a user will
223 be warned their password is about to expire.
229 If none of the options are selected, <command>chage</command> operates
230 in an interactive fashion, prompting the user with the current values
231 for all of the fields. Enter the new value to change the field, or
232 leave the line blank to use the current value. The current value is
233 displayed between a pair of <emphasis>[ ]</emphasis> marks.
239 The <command>chage</command> program requires a shadow password file to
242 <para>The <command>chage</command> command is restricted to the root
243 user, except for the <option>-l</option> option, which may be used by
244 an unprivileged user to determine when their password or account is due
249 <refsect1 id='configuration'>
250 <title>CONFIGURATION</title>
252 The following configuration variables in
253 <filename>/etc/login.defs</filename> change the behavior of this
261 <refsect1 id='files'>
266 <filename>/etc/passwd</filename>
269 <para>User account information.</para>
274 <filename>/etc/shadow</filename>
277 <para>Secure user account information.</para>
283 <refsect1 id='exit_values'>
284 <title>EXIT VALUES</title>
286 The <command>chage</command> command exits with the following values:
289 <term><replaceable>0</replaceable></term>
295 <term><replaceable>1</replaceable></term>
297 <para>permission denied</para>
301 <term><replaceable>2</replaceable></term>
303 <para>invalid command syntax</para>
307 <term><replaceable>15</replaceable></term>
309 <para>can't find the shadow password file</para>
316 <refsect1 id='see_also'>
317 <title>SEE ALSO</title>
320 <refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
323 <refentrytitle>shadow</refentrytitle><manvolnum>5</manvolnum>