On a host where /etc/passwd password fields contain x, locate the file holding password hashes.
Which file is appropriate?
With shadow passwords, /etc/passwd contains a marker such as x and hashes plus aging data are stored in /etc/shadow.
Detailed explanation
/etc/shadowCorrect. /etc/shadow stores the password hashes and aging fields.
Correct. /etc/shadow stores the password hashes and aging fields.
/etc/groupIncorrect. /etc/group stores group membership data.
Incorrect. /etc/group stores group membership data.
/etc/nologinIncorrect. /etc/nologin temporarily blocks non-root logins.
Incorrect. /etc/nologin temporarily blocks non-root logins.
/etc/hostsIncorrect. /etc/hosts maps names to addresses.
Incorrect. /etc/hosts maps names to addresses.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'trainee:x:1000:1000::/home/trainee:/bin/bash' | cut -d: -f1,2Expected result
trainee:xKey points
- x in /etc/passwd
- Hashes in /etc/shadow
- Separate authentication data
Notes
- Environment: GNU cut / 一時入力のみ
- 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.