Emergency /etc/passwd Recovery
Recover a corrupted /etc/passwd that has locked out all users including root.
A advanced Linux challenge worth 20 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
A buggy user-management script merged entries in /etc/passwd — no newlines between them. All logins fail including root. The lab provides a corrupted copy at /tmp/test-passwd to practice the repair workflow.
Your tasks:
- Inspect /tmp/test-passwd — each entry must be on its own line with exactly 6 colons
- Find malformed lines: grep -v "^#" /tmp/test-passwd | awk -F: 'NF!=7'
- Repair the file manually using nano/sed — split merged entries onto separate lines
- Validate: awk -F: 'NF!=7 {print NR": "NF" fields: "$0}' /tmp/test-passwd (should print nothing)
- Write "RECOVERED" to /tmp/recovery_done.txt
- Run check to validate