1PASSWD(1) User utilities PASSWD(1)
2
3
4
6 passwd - update user's authentication tokens
7
8
10 passwd [-k] [-l] [-u [-f]] [-d] [-e] [-n mindays] [-x maxdays] [-w
11 warndays] [-i inactivedays] [-S] [--stdin] [username]
12
13
14
16 The passwd utility is used to update user's authentication token(s).
17
18 This task is achieved through calls to the Linux-PAM and Libuser API.
19 Essentially, it initializes itself as a "passwd" service with Linux-PAM
20 and utilizes configured password modules to authenticate and then
21 update a user's password.
22
23
24 A simple entry in the global Linux-PAM configuration file for this ser‐
25 vice would be:
26
27 #
28 # passwd service entry that does strength checking of
29 # a proposed password before updating it.
30 #
31 passwd password requisite pam_cracklib.so retry=3
32 passwd password required pam_unix.so use_authtok
33 #
34
35
36 Note, other module types are not required for this application to func‐
37 tion correctly.
38
39
41 -k, --keep
42 The option -k is used to indicate that the update should only be
43 for expired authentication tokens (passwords); the user wishes
44 to keep their non-expired tokens as before.
45
46
47 -l, --lock
48 This option is used to lock the password of specified account
49 and it is available to root only. The locking is performed by
50 rendering the encrypted password into an invalid string (by pre‐
51 fixing the encrypted string with an !). Note that the account is
52 not fully locked - the user can still log in by other means of
53 authentication such as the ssh public key authentication. Use
54 chage -E 0 user command instead for full account locking.
55
56
57 --stdin
58 This option is used to indicate that passwd should read the new
59 password from standard input, which can be a pipe.
60
61
62 -u, --unlock
63 This is the reverse of the -l option - it will unlock the
64 account password by removing the ! prefix. This option is avail‐
65 able to root only. By default passwd will refuse to create a
66 passwordless account (it will not unlock an account that has
67 only "!" as a password). The force option -f will override this
68 protection.
69
70
71 -d, --delete
72 This is a quick way to delete a password for an account. It will
73 set the named account passwordless. Available to root only.
74
75
76 -e, --expire
77 This is a quick way to expire a password for an account. The
78 user will be forced to change the password during the next login
79 attempt. Available to root only.
80
81
82 -f, --force
83 Force the specified operation.
84
85
86 -n, --minimum DAYS
87 This will set the minimum password lifetime, in days, if the
88 user's account supports password lifetimes. Available to root
89 only.
90
91
92 -x, --maximum DAYS
93 This will set the maximum password lifetime, in days, if the
94 user's account supports password lifetimes. Available to root
95 only.
96
97
98 -w, --warning DAYS
99 This will set the number of days in advance the user will begin
100 receiving warnings that her password will expire, if the user's
101 account supports password lifetimes. Available to root only.
102
103
104 -i, --inactive DAYS
105 This will set the number of days which will pass before an
106 expired password for this account will be taken to mean that the
107 account is inactive and should be disabled, if the user's
108 account supports password lifetimes. Available to root only.
109
110
111 -S, --status
112 This will output a short information about the status of the
113 password for a given account. Available to root user only.
114
115
117 Protect your password.
118 Don't write down your password - memorize it. In particular,
119 don't write it down and leave it anywhere, and don't place it in
120 an unencrypted file! Use unrelated passwords for systems con‐
121 trolled by different organizations. Don't give or share your
122 password, in particular to someone claiming to be from computer
123 support or a vendor. Don't let anyone watch you enter your
124 password. Don't enter your password to a computer you don't
125 trust or if things "look funny"; someone may be trying to hijack
126 your password. Use the password for a limited time and change
127 it periodically.
128
129
130 Choose a hard-to-guess password.
131 passwd through the calls to the pam_cracklib PAM module will try
132 to prevent you from choosing a really bad password, but it isn't
133 foolproof; create your password wisely. Don't use something
134 you'd find in a dictionary (in any language or jargon). Don't
135 use a name (including that of a spouse, parent, child, pet, fan‐
136 tasy character, famous person, and location) or any variation of
137 your personal or account name. Don't use accessible information
138 about you (such as your phone number, license plate, or social
139 security number) or your environment. Don't use a birthday or a
140 simple pattern (such as "qwerty", "abc", or "aaa"). Don't use
141 any of those backwards, followed by a digit, or preceded by a
142 digit. Instead, use a mixture of upper and lower case letters,
143 as well as digits or punctuation. When choosing a new password,
144 make sure it's unrelated to any previous password. Use long
145 passwords (say at least 8 characters long). You might use a
146 word pair with punctuation inserted, a passphrase (an under‐
147 standable sequence of words), or the first letter of each word
148 in a passphrase.
149
150
151
152 These principles are partially enforced by the system, but only partly
153 so. Vigilance on your part will make the system much more secure.
154
155
157 On successful completion of its task, passwd will complete with exit
158 code 0. An exit code of 1 indicates an error occurred. Textual errors
159 are written to the standard error stream.
160
161
163 Linux-PAM (Pluggable Authentication modules for Linux).
164
165
167 /etc/pam.d/passwd - the Linux-PAM configuration file
168
169
171 None known.
172
173
175 pam(8), pam.d(5), libuser.conf(5), and pam_chauthtok(3).
176
177
178 For more complete information on how to configure this application with
179 Linux-PAM, see the Linux-PAM System Administrators' Guide.
180
181
183 Cristian Gafton <gafton@redhat.com>
184
185
186
187GNU/Linux Jun 20 2012 PASSWD(1)