passwd.1 (2010 09)
p
passwd(1) passwd(1)
NAME
passwd - change login password and associated attributes
SYNOPSIS
passwd [name]
passwd -r files [-F file][name]
passwd -r files [-e
[shell ]] [-gh][name]
passwd -r files -s [-a
]
passwd -r files -s [name]
passwd -r files [-d
-l][-f][-n min][-w warn][
-x max] name
passwd -r nis [-e [shell ]] [
-gh][name]
passwd -r dce [-e [shell ]] [
-gh][name]
DESCRIPTION
The
passwd command modifies the password as well as the attributes associated with the login name.If
name is omitted, it defaults to the invoking user’s login name, which is determined using
getuid. See
getuid (2).
Ordinary users can only change passwords corresponding to their login name. If an old password has
been established, it is requested from the user. If valid, a new password is obtained. Once the new pass-
word is entered, it is determined if the old password has "aged" sufficiently. If password aging is not
sufficient, the new password is rejected and
passwd terminates. See passwd (4).
If password aging and construction requirements are met, the password is re-entered to ensure con-
sistency. If the new copy differs,
passwd repeats the new password prompting cycle, at most twice.
A superuser, whose effective user ID is zero, (see id(1) and su(1)), is allowed to change any password and
is not forced to comply with password aging. On a trusted system, superusers are prompted for old pass-
words. On standard systems, superusers are not forced to comply with password construction require-
ments. Refer also to the Password Construction Requirements section of this manpage. Null passwords
can be created by entering a carriage return in response to the prompt for a new password.
For the
files (local system) repository, if no /etc/shadow file exists, then the encrypted password is
stored in the password field of /etc/passwd. If the /etc/shadow file exists, then the encrypted pass-
word is stored there, and an ’x’ is added to the password field of
/etc/passwd.
The DCE repository (
-r dce) is only available if Integrated Login has been configured. See
auth.adm (1M). If Integrated Login has been configured, other considerations apply. A user with
appropriate DCE privileges is capable of modifying a user’s password, shell, gecos or home directory and
this is not dependent upon superuser privileges.
If the repository is not specified, that is,
passwd [name], the password is changed in all existing reposi-
tories configured in /etc/nsswitch.conf. If password options are used, and no repository is
specified, the default repository is files.
Options
The following options are recognized:
-e shell Modify the default shell for the user’s login name in the password file. If the shell is not
provided, the user will be prompted to enter the default login shell.
-F name The default password file is /etc/passwd. The -F option can be used to choose an
alternate password file, where read and write permissions are required. This option is
only available when using the files repository, and it is not intended for trusted mode.
-g Change the gecos information in the password file, which is used by the finger com-
mand. The user is prompted for each subfield: name, location, work phone, and home
phone.
-r repository Specify the repository to which the operation is to be applied. Supported repositories
include files, nis, and dce. If repository is not specified, the default is files.
-s name Display some password attributes associated with the specified name. Superuser
privilege is required if the files repository is specified.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1