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, the login name associated with the current terminal is used. You are prompted for the new password or password phrase, which may 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 will be 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 will be 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:
  • The user specified does not exist.
  • The current password or password phrase is incorrect.
  • The new password or password phrase does not meet the installation-exit requirements.
2
The new password or password phrase was not entered the same way twice.
4
Error obtaining user login name.