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.
Incorrect. Without an argument, passwd changes the invoking user's password.
passwd app01Correct. passwd app01 targets app01's password.
Correct. passwd app01 targets app01's password.
useradd app01Incorrect. useradd creates a user rather than changing an existing password.
Incorrect. 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.
Incorrect. -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
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.