As an administrator, interactively set a new password for existing user app01.
Which command is appropriate?
passwd USER interactively sets the specified existing user's password when run with appropriate privileges. Do not place plaintext passwords in command arguments.
Detailed explanation
passwdIncorrect. Without an argument, passwd changes the invoking user's password.
passwd app01Correct. passwd app01 targets app01's password.
useradd app01Incorrect. useradd creates a user rather than changing an existing password.
usermod -p app01Incorrect. -p expects an encrypted password and this form omits the target properly.
Try it yourself
An example you can run in a temporary verification environment.
passwd --help | sed -n '1,12p'Expected result
passwd [options] [LOGIN]の使用方法Key points
- The argument is the target login
- Password is entered interactively
- Avoid plaintext command-line values
Notes
- Environment: shadow-utils passwd help / 状態変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Account record
Identity attributes such as a user ID, home directory, and login shell.
Group membership
Primary and supplementary groups used during permission checks.
Password aging
State and time limits that control password changes and account access.