Bird
0
0

You want to create a script that lists all users with locked passwords. Which file and field should you check?

hard📝 Application Q8 of 15
Linux CLI - Users and Groups
You want to create a script that lists all users with locked passwords. Which file and field should you check?
ACheck /etc/passwd, seventh field for '/bin/false'
BCheck /etc/passwd, second field for 'x' character
CCheck /etc/group, third field for '!' character
DCheck /etc/shadow, second field for '!' or '*' prefix
Step-by-Step Solution
Solution:
  1. Step 1: Understand password locking in /etc/shadow

    Locked passwords are indicated by '!' or '*' at the start of the encrypted password field (second field) in /etc/shadow.
  2. Step 2: Identify correct file and field

    /etc/passwd second field is a placeholder, /etc/group does not store passwords, and shell field in /etc/passwd is unrelated to password locking.
  3. Final Answer:

    Check /etc/shadow, second field for '!' or '*' prefix -> Option D
  4. Quick Check:

    Locked password indicator = /etc/shadow second field [OK]
Quick Trick: Locked passwords start with ! or * in /etc/shadow second field [OK]
Common Mistakes:
  • Checking /etc/passwd second field for lock
  • Looking in /etc/group for password info
  • Confusing shell field with password status

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes