Inspect an /etc/shadow record as an administrator.
alice:$6$examplehash:20000:0:90:7::: Which field stores a password hash or a lock marker?
The second shadow field stores the password hash or markers such as !; protect shadow from ordinary users.
Detailed explanation
Incorrect. The first field is the login name.
Correct. The second field stores the hash or a lock marker such as !.
Incorrect. The third field records the last password-change day.
Incorrect. The fifth field is the maximum password age.
Try it yourself
An example you can run in a temporary verification environment.
entry='alice:$6$examplehash:20000:0:90:7:::'; printf '%s\n' "$entry" | cut -d: -f2Expected result
$6$examplehashKey points
- First field is login name
- Second is password field
- Do not expose shadow
Notes
- Environment: POSIXシェル / 合成レコード
- 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.