2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
5 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the
6 .\" fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH PASSWD 1 "Feb 25, 2017"
9 passwd \- change login password and password attributes
13 \fBpasswd\fR [\fB-r\fR files | \fB-r\fR ldap | \fB-r\fR nis] [\fIname\fR]
18 \fBpasswd\fR [\fB-r\fR files] [\fB-egh\fR] [\fIname\fR]
23 \fBpasswd\fR [\fB-r\fR files] \fB-s\fR [\fB-a\fR]
28 \fBpasswd\fR [\fB-r\fR files] \fB-s\fR [\fIname\fR]
33 \fBpasswd\fR [\fB-r\fR files] [\fB-d\fR | \fB-l\fR | \fB-u\fR | \fB-N\fR] [\fB-f\fR] [\fB-n\fR \fImin\fR]
34 [\fB-w\fR \fIwarn\fR] [\fB-x\fR \fImax\fR] \fIname\fR
39 \fBpasswd\fR \fB-r\fR ldap [\fB-egh\fR] [\fIname\fR]
44 \fBpasswd\fR [\fB-r\fR ldap ] \fB-s\fR [\fB-a\fR]
49 \fBpasswd\fR [\fB-r\fR ldap ] \fB-s\fR [\fIname\fR]
54 \fBpasswd\fR \fB-r\fR ldap [\fB-d | -l | -u | -N\fR] [\fB-f\fR] [\fB-n\fR \fImin\fR] [\fB-w\fR \fIwarn\fR] [\fB-x\fR \fImax\fR] \fIname\fR
59 \fBpasswd\fR \fB-r\fR nis [\fB-egh\fR] [\fIname\fR]
64 The \fBpasswd\fR command changes the password or lists password attributes
65 associated with the user's login \fIname\fR. Additionally, privileged users can
66 use \fBpasswd\fR to install or change passwords and attributes associated with
70 When used to change a password, \fBpasswd\fR prompts everyone for their old
71 password, if any. It then prompts for the new password twice. When the old
72 password is entered, \fBpasswd\fR checks to see if it has aged sufficiently. If
73 \fBaging\fR is insufficient, \fBpasswd\fR terminates; see \fBpwconv\fR(1M)
74 and \fBshadow\fR(4) for additional information.
77 The \fBpwconv\fR command creates and updates \fB/etc/shadow\fR with information
78 from \fB/etc/passwd\fR. \fBpwconv\fR relies on a special value of \fBx\fR in
79 the password field of \fB/etc/passwd\fR. This value of \fBx\fR indicates that
80 the password for the user is already in \fB/etc/shadow\fR and should not be
84 If aging is sufficient, a check is made to ensure that the new password meets
85 construction requirements. When the new password is entered a second time, the
86 two copies of the new password are compared. If the two copies are not
87 identical, the cycle of prompting for the new password is repeated for, at
91 Passwords must be constructed to meet the following requirements:
96 Each password must have \fBPASSLENGTH\fR characters, where \fBPASSLENGTH\fR is
97 defined in \fB/etc/default/passwd\fR and is set to \fB6\fR. Setting
98 \fBPASSLENGTH\fR to more than eight characters requires configuring
99 \fBpolicy.conf\fR(4) with an algorithm that supports greater than eight
106 Each password must meet the configured complexity constraints specified in
107 \fB/etc/default/passwd\fR.
113 Each password must not be a member of the configured dictionary as specified in
114 \fB/etc/default/passwd\fR.
120 For accounts in name services which support password history checking, if prior
121 password history is defined, new passwords must not be contained in the prior
126 If all requirements are met, by default, the \fBpasswd\fR command consults
127 \fB/etc/nsswitch.conf\fR to determine in which repositories to perform password
128 update. It searches the \fBpasswd\fR and \fBpasswd_compat\fR entries. The
129 sources (repositories) associated with these entries are updated. However, the
130 password update configurations supported are limited to the following cases.
131 Failure to comply with the configurations prevents users from logging onto the
132 system. The password update configurations are:
143 \fBpasswd: files ldap\fR
149 \fBpasswd: files nis\fR
155 \fBpasswd: compat\fR (==> files nis)
161 \fBpasswd: compat\fR (==> files ldap)
163 \fBpasswd_compat: ldap\fR
167 You can add the \fBad\fR keyword to any of the \fBpasswd\fR configurations in
168 the above list. However, you cannot use the \fBpasswd\fR command to change the
169 password of an Active Directory (AD) user. If the \fBad\fR keyword is found in
170 the \fBpasswd\fR entry during a password update operation, it is ignored. To
171 update the password of an AD user, use the \fBkpasswd\fR(1) command.
174 The administrator configured for updating LDAP shadow
175 information can change any password attributes. See \fBldapclient\fR(1M).
178 When a user has a password stored in one of the name services as well as a
179 local \fBfiles\fR entry, the \fBpasswd\fR command updates both. It is possible
180 to have different passwords in the name service and local files entry. Use
181 \fBpasswd\fR \fB-r\fR to change a specific password repository.
184 In the \fBfiles\fR case, super-users (for instance, real and effective uid
185 equal to \fB0\fR, see \fBid\fR(1M) and \fBsu\fR(1M)) can change any password.
186 Hence, \fBpasswd\fR does not prompt privileged users for the old password.
187 Privileged users are not forced to comply with password aging and password
188 construction requirements. A privileged user can create a null password by
189 entering a carriage return in response to the prompt for a new password. (This
190 differs from \fBpasswd\fR \fB-d\fR because the \fBpassword\fR prompt is still
191 displayed.) If NIS is in effect, superuser on the root master can change any
192 password without being prompted for the old NIS \fBpasswd\fR, and is not forced
193 to comply with password construction requirements.
196 If LDAP is in effect, superuser on any Native LDAP client system can change any
197 password without being prompted for the old LDAP passwd, and is not forced to
198 comply with password construction requirements.
201 Normally, \fBpasswd\fR entered with no arguments changes the password of the
202 current user. When a user logs in and then invokes \fBsu\fR(1M) to become
203 superuser or another user, \fBpasswd\fR changes the original user's password,
204 not the password of the superuser or the new user.
207 Any user can use the \fB-s\fR option to show password attributes for his or her
208 own login \fIname\fR. Otherwise, the \fB-s\fR argument is restricted to the
212 The format of the display is:
216 \fIname status mm/dd/yy min max warn\fR
223 or, if password aging information is not present,
241 The login \fBID\fR of the user.
250 The password status of \fIname\fR.
252 The \fIstatus\fR field can take the following values:
259 This account is \fBlocked\fR account. See Security.
268 This account is a \fBno login\fR account. See \fBSecurity\fR.
277 This account has no password and is therefore open without authentication.
286 This account has a password.
297 The date password was last changed for \fIname\fR. All password aging dates are
298 determined using Greenwich Mean Time (Universal Time) and therefore can differ
299 by as much as a day in other time zones.
308 The minimum number of days required between password changes for \fIname\fR.
309 \fBMINWEEKS\fR is found in \fB/etc/default/passwd\fR and is set to \fBNULL\fR.
318 The maximum number of days the password is valid for \fIname\fR. \fBMAXWEEKS\fR
319 is found in \fB/etc/default/passwd\fR and is set to \fBNULL\fR.
328 The number of days relative to \fImax\fR before the password expires and the
329 \fIname\fR are warned.
334 \fBpasswd\fR uses \fBpam\fR(3PAM) for password change. It calls PAM with a
335 service name \fBpasswd\fR and uses service module type \fBauth\fR for
336 authentication and password for password change.
339 Locking an account (\fB-l\fR option) does not allow its use for password based
340 login or delayed execution (such as \fBat\fR(1), \fBbatch\fR(1), or
341 \fBcron\fR(1M)). The \fB-N\fR option can be used to disallow password based
342 login, while continuing to allow delayed execution.
345 The following options are supported:
352 Shows password attributes for all entries. Use only with the \fB-s\fR option.
353 \fIname\fR must not be provided. For the \fBfiles\fR and \fBldap\fR
354 repositories, this is restricted to the superuser.
363 Changes the login shell. The choice of shell is limited by the requirements
364 of \fBgetusershell\fR(3C). If the user currently has a shell that is not
365 allowed by \fBgetusershell\fR, only root can change it.
374 Changes the gecos (finger) information. For the \fBfiles\fR repository, this
375 only works for the superuser. Normal users can change the \fBldap\fR or
376 \fBnis\fR repositories.
385 Changes the home directory.
394 Specifies the repository to which an operation is applied. The supported
395 repositories are \fBfiles\fR, \fBldap\fR, or \fBnis\fR.
401 \fB\fB-s\fR \fIname\fR\fR
404 Shows password attributes for the login \fIname\fR. For the \fBfiles\fR and
405 \fBldap\fR repositories, this only works for the superuser. It does not work
406 at all for the \fBnis\fR repository which does not support password aging.
408 The output of this option, and only this option is Stable and parsable. The
409 format is \fIusername\fR followed by white space followed by one of the
412 New codes might be added in the future so code that parses this must be
413 flexible in the face of unknown codes. While all existing codes are two
414 characters in length that might not always be the case.
416 The following are the current status codes:
423 Account is locked for UNIX authentication. \fBpasswd -l\fR was run or the
424 authentication failed \fBRETRIES\fR times.
433 The account is a no login account. \fBpasswd -N\fR has been run.
442 Account has no password. \fBpasswd -d\fR was run.
451 The account probably has a valid password.
460 The data in the password field is unknown. It is not a recognizable hashed
461 password or any of the above entries. See \fBcrypt\fR(3C) for valid password
467 .SS "Privileged User Options"
469 Only a privileged user can use the following options:
476 Deletes password for \fIname\fR and unlocks the account. The login \fIname\fR
477 is not prompted for password. It is only applicable to the \fBfiles\fR and
478 \fBldap\fR repositories.
480 If the \fBlogin\fR(1) option \fBPASSREQ=YES\fR is configured, the account is
481 not able to login. \fBPASSREQ=YES\fR is the delivered default.
490 Forces the user to change password at the next login by expiring the password
500 Locks password entry for \fIname\fR. See the \fB-d\fR or \fB-u\fR option for
501 unlocking the account.
510 Makes the password entry for name a value that cannot be used for login, but
511 does not lock the account. See the \fB-d\fR option for removing the value, or
512 to set a password to allow logins.
518 \fB\fB-n\fR \fImin\fR\fR
521 Sets minimum field for \fIname\fR. The \fImin\fR field contains the minimum
522 number of days between password changes for \fIname\fR. If \fImin\fR is greater
523 than \fImax\fR, the user can not change the password. Always use this option
524 with the \fB-x\fR option, unless \fImax\fR is set to \fB\(mi1\fR (aging turned
525 off). In that case, \fImin\fR need not be set.
534 Unlocks a locked password for entry name. See the \fB-d\fR option for removing
535 the locked password, or to set a password to allow logins.
541 \fB\fB-w\fR \fIwarn\fR\fR
544 Sets warn field for \fIname\fR. The \fIwarn\fR field contains the number of
545 days before the password expires and the user is warned. This option is not
546 valid if password aging is disabled.
552 \fB\fB-x\fR \fImax\fR\fR
555 Sets maximum field for \fIname\fR. The \fImax\fR field contains the number of
556 days that the password is valid for \fIname\fR. The aging for \fIname\fR is
557 turned off immediately if \fImax\fR is set to \fB\(mi1\fR\&.
562 The following operand is supported:
572 .SH ENVIRONMENT VARIABLES
574 If any of the \fBLC_*\fR variables, that is, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
575 \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR (see
576 \fBenviron\fR(5)), are not set in the environment, the operational behavior of
577 \fBpasswd\fR for each corresponding locale category is determined by the value
578 of the \fBLANG\fR environment variable. If \fBLC_ALL\fR is set, its contents
579 are used to override both the \fBLANG\fR and the other \fBLC_*\fR variables. If
580 none of the above variables is set in the environment, the \fBC\fR (U.S. style)
581 locale determines how \fBpasswd\fR behaves.
588 Determines how \fBpasswd\fR handles characters. When \fBLC_CTYPE\fR is set to a
589 valid value, \fBpasswd\fR can display and handle text and filenames containing
590 valid characters for that locale. \fBpasswd\fR can display and handle Extended
591 Unix Code (\fBEUC\fR) characters where any individual character can be 1, 2, or
592 3 bytes wide. \fBpasswd\fR can also handle \fBEUC\fR characters of 1, 2, or
593 more column widths. In the \fBC\fR locale, only characters from ISO 8859-1 are
600 \fB\fBLC_MESSAGES\fR\fR
603 Determines how diagnostic and informative messages are presented. This includes
604 the language and style of the messages, and the correct form of affirmative and
605 negative responses. In the \fBC\fR locale, the messages are presented in the
606 default form found in the program itself (in most cases, U.S. English).
611 The \fBpasswd\fR command exits with one of the following values:
636 Invalid combination of options.
645 Unexpected failure. Password file unchanged.
654 Unexpected failure. Password file(s) missing.
663 Password file(s) busy. Try again later.
672 Invalid argument to option.
681 Aging option is disabled.
714 \fB\fB/etc/default/passwd\fR\fR
717 Default values can be set for the following flags in \fB/etc/default/passwd\fR.
718 For example: \fBMAXWEEKS=26\fR
722 \fB\fBDICTIONDBDIR\fR\fR
725 The directory where the generated dictionary databases reside. Defaults to
728 If neither \fBDICTIONLIST\fR nor \fBDICTIONDBDIR\fR is specified, the system
729 does not perform a dictionary check.
735 \fB\fBDICTIONLIST\fR\fR
738 DICTIONLIST can contain list of comma separated dictionary files such as
739 \fBDICTIONLIST=\fR\fIfile1\fR, \fIfile2\fR, \fIfile3\fR. Each dictionary file
740 contains multiple lines and each line consists of a word and a NEWLINE
741 character (similar to \fB/usr/share/lib/dict/words\fR.) You must specify full
742 pathnames. The words from these files are merged into a database that is used
743 to determine whether a password is based on a dictionary word.
745 If neither \fBDICTIONLIST\fR nor \fBDICTIONDBDIR\fR is specified, the system
746 does not perform a dictionary check.
748 To pre-build the dictionary database, see \fBmkpwdict\fR(1M).
757 Maximum number of prior password history to keep for a user. Setting the
758 \fBHISTORY\fR value to zero (\fB0\fR), or removing the flag, causes the prior
759 password history of all users to be discarded at the next password change by
760 any user. The default is not to define the \fBHISTORY\fR flag. The maximum
761 value is \fB26.\fR Currently, this functionality is enforced only for user
762 accounts defined in the \fBfiles\fR name service (local
763 \fBpasswd\fR(4)/\fBshadow\fR(4)).
769 \fB\fBMAXREPEATS\fR\fR
772 Maximum number of allowable consecutive repeating characters. If
773 \fBMAXREPEATS\fR is not set or is zero (\fB0\fR), the default is no checks
782 Maximum time period that password is valid.
791 Minimum number of alpha character required. If \fBMINALPHA\fR is not set, the
801 Minimum differences required between an old and a new password. If
802 \fBMINDIFF\fR is not set, the default is \fB3\fR.
811 Minimum number of digits required. If \fBMINDIGIT\fR is not set or is set to
812 zero (\fB0\fR), the default is no checks. You cannot be specify \fBMINDIGIT\fR
813 if \fBMINNONALPHA\fR is also specified.
822 Minimum number of lower case letters required. If not set or zero (0), the
823 default is no checks.
829 \fB\fBMINNONALPHA\fR\fR
832 Minimum number of non-alpha (including numeric and special) required. If
833 \fBMINNONALPHA\fR is not set, the default is \fB1\fR. You cannot specify
834 \fBMINNONALPHA\fR if \fBMINDIGIT\fR or \fBMINSPECIAL\fR is also specified.
843 Minimum time period before the password can be changed.
849 \fB\fBMINSPECIAL\fR\fR
852 Minimum number of special (non-alpha and non-digit) characters required. If
853 \fBMINSPECIAL\fR is not set or is zero (\fB0\fR), the default is no checks. You
854 cannot specify \fBMINSPECIAL\fR if you also specify \fBMINNONALPHA\fR.
863 Minimum number of upper case letters required. If \fBMINUPPER\fR is not set or
864 is zero (\fB0\fR), the default is no checks.
870 \fB\fBNAMECHECK\fR\fR
873 Enable/disable checking or the login name. The default is to do login name
874 checking. A case insensitive value of \fBno\fR disables this feature.
880 \fB\fBPASSLENGTH\fR\fR
883 Minimum length of password, in characters.
889 \fB\fBWARNWEEKS\fR\fR
892 Time period until warning of date of password's ensuing expiration.
898 \fB\fBWHITESPACE\fR\fR
901 Determine if white space characters are allowed in passwords. Valid values are
902 \fBYES\fR and \fBNO\fR. If \fBWHITESPACE\fR is not set or is set to \fBYES\fR,
903 white space characters are allowed.
911 \fB\fB/etc/oshadow\fR\fR
914 Temporary file used by \fBpasswd\fR, \fBpassmgmt\fR and \fBpwconv\fR to update
915 the real shadow file.
921 \fB\fB/etc/passwd\fR\fR
930 \fB\fB/etc/shadow\fR\fR
933 Shadow password file.
939 \fB\fB/etc/shells\fR\fR
947 See \fBattributes\fR(5) for descriptions of the following attributes:
955 ATTRIBUTE TYPE ATTRIBUTE VALUE
959 Interface Stability See below.
964 The human readable output is Uncommitted. The options are Committed.
967 \fBat\fR(1), \fBbatch\fR(1), \fBfinger\fR(1), \fBkpasswd\fR(1), \fBlogin\fR(1),
968 \fBcron\fR(1M), \fBdomainname\fR(1M), \fBeeprom\fR(1M),
969 \fBid\fR(1M), \fBldapclient\fR(1M), \fBmkpwdict\fR(1M), \fBpassmgmt\fR(1M),
970 \fBpwconv\fR(1M), \fBsu\fR(1M), \fBuseradd\fR(1M), \fBuserdel\fR(1M),
971 \fBusermod\fR(1M), \fBcrypt\fR(3C), \fBgetpwnam\fR(3C), \fBgetspnam\fR(3C),
972 \fBgetusershell\fR(3C), \fBpam\fR(3PAM),
973 \fBloginlog\fR(4), \fBnsswitch.conf\fR(4), \fBpam.conf\fR(4), \fBpasswd\fR(4),
974 \fBpolicy.conf\fR(4), \fBshadow\fR(4), \fBshells\fR(4), \fBattributes\fR(5),
975 \fBenviron\fR(5), \fBpam_authtok_check\fR(5), \fBpam_authtok_get\fR(5),
976 \fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), \fBpam_ldap\fR(5),
977 \fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5), \fBpam_unix_session\fR(5)
980 The \fBpam_unix\fR(5) module is no longer supported. Similar functionality is
981 provided by \fBpam_unix_account\fR(5), \fBpam_unix_auth\fR(5),
982 \fBpam_unix_session\fR(5), \fBpam_authtok_check\fR(5),
983 \fBpam_authtok_get\fR(5), \fBpam_authtok_store\fR(5), \fBpam_dhkeys\fR(5), and
984 \fBpam_passwd_auth\fR(5).
987 The \fByppasswd\fR command is a wrapper around \fBpasswd\fR. Use of
988 \fByppasswd\fR is discouraged. Use \fBpasswd\fR \fB-r\fR \fIrepository_name\fR
992 Changing a password in the \fBfiles\fR and \fBldap\fR repositories clears the
996 Changing a password reactivates an account deactivated for inactivity for the
997 length of the inactivity period.
1000 If \fB/etc/shells\fR is present, and is corrupted, it may provide an attack
1001 vector that would compromise the system. The \fBgetusershell\fR(3c) library
1002 call has a pre-vetted list of shells, so /etc/shells should be used with
1006 Input terminal processing might interpret some key sequences and not pass them
1007 to the \fBpasswd\fR command.
1010 An account with no password, status code \fBNP\fR, might not be able to login.
1011 See the \fBlogin\fR(1) \fBPASSREQ\fR option.