Challenge - 5 Problems
Shadow and Passwd Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of this command?
You run the command
cut -d: -f1 /etc/passwd | head -3. What is the expected output?Linux CLI
cut -d: -f1 /etc/passwd | head -3Attempts:
2 left
💡 Hint
The first field in /etc/passwd is the username. The command extracts usernames and shows the first three.
✗ Incorrect
The /etc/passwd file lists user accounts. The first three usernames are usually root, daemon, and bin in that order.
🧠 Conceptual
intermediate1:30remaining
What is the main difference between /etc/passwd and /etc/shadow?
Choose the correct statement about the difference between
/etc/passwd and /etc/shadow files.Attempts:
2 left
💡 Hint
Think about file permissions and security of password storage.
✗ Incorrect
/etc/passwd contains user account info and is world-readable. /etc/shadow contains encrypted passwords and is only readable by root for security.
🔧 Debug
advanced1:30remaining
Why does this script fail to read /etc/shadow?
A user runs this script to read the first line of /etc/shadow:
#!/bin/bash head -1 /etc/shadowBut it shows a permission denied error. Why?
Attempts:
2 left
💡 Hint
Check file permissions of /etc/shadow.
✗ Incorrect
/etc/shadow contains sensitive password hashes and is only readable by root. Normal users get permission denied errors.
🚀 Application
advanced2:00remaining
Extract usernames with locked passwords from /etc/shadow
Which command correctly lists usernames whose password field in /etc/shadow starts with an exclamation mark (!) indicating locked accounts?
Attempts:
2 left
💡 Hint
Look for lines where the second field starts with ! and print the first field.
✗ Incorrect
The password field is the second field in /etc/shadow. Using awk with field separator ':' and regex /^!/ on $2 correctly filters locked accounts.
📝 Syntax
expert1:30remaining
What error does this command produce?
What error will this command produce?
cut -d: -f1 /etc/shadow | head -3
Attempts:
2 left
💡 Hint
Consider file permissions of /etc/shadow for normal users.
✗ Incorrect
Normal users cannot read /etc/shadow, so cut command fails with permission denied error.