Intermediate · 12 min · practise every command in the built-in terminal

🎯 Mission Briefing: Locked Out After the Holiday

Maria from accounting is back from two weeks of holiday and can't log in — and she needs the server today for the month-end report. Her password is right, she says. The helpdesk ticket is in your home directory.

Your objective

Find out why Linux refuses Maria, fix her account, and check that it's really fixed.

Investigation toolkit

cat ~/ticket-4521.txt                    # What does the user see?
journalctl -u sshd | grep maria          # What does the server say?
sudo grep maria /var/log/auth.log        # The same in the classic auth log
sudo passwd -S maria                     # Password status: P = usable, L = locked
sudo chage -l maria                      # Password and account expiry dates

Fix and verify

sudo passwd -u maria                     # Unlock the password
sudo chage -E -1 maria                   # The account never expires
sudo chage -l maria                      # "Account expires : never"

💡 A locked password is stored with a ! in front in /etc/shadow. An account expiry date is a separate lock — Maria needed both removed.

Practice tasks

  1. Find the log lines that say why Maria can't log in
  2. Check the status of Maria's password
  3. Unlock Maria's password
  4. Remove the expiry date from Maria's account
  5. Show Maria's ageing information to confirm

Missions