passwd — Change user passwords or password phrases

Format

passwd [–u userid]

Description

passwd changes the login password or password phrase for the user ID specified. If userid is omitted, or Start of changeif the -u option is omitted,End of change the login name that is associated with the current terminal is used. You are prompted for the new password or password phrase, which might be truncated to the length defined as the maximum length for the passwords.

Users can change the password or password phrase for another user if they know the user ID and current password or password phrase.

Examples

  1. To change your password or password phrase, issue:
    passwd
    You are prompted for the old password or password phrase and the new password or password phrase.
  2. To change the password or password phrase for user ID Steve, issue:
    passwd -u steve
    You are prompted for the old password or password phrase and the new password or password phrase.

Exit values

0
The password or password phrase was changed.
1
Failure due to any of the following reasons:
  • The specified user does not exist.
  • The current password or password phrase is incorrect.
  • The new password or password phrase does not meet the requirements of the installation exit.
2
The new password or password phrase was not entered the same way twice.
4
Error obtaining user login name.