back to labs
Account Hygiene: Orphaned Home Directories
MediumLinux Security20-25 minThe brief
After a batch of offboardings, this NFS server's exported home tree at /export/home is out of sync with the account database: some home directories are owned by a UID that no longer has an /etc/passwd entry — classic leftover-access findings an auditor flags every time. Walk /export/home, identify every directory whose owner UID resolves to NO account, record their full paths (like /export/home/<name>), one per line, in the file /root/answers/orphaned.txt, then remediate by removing exactly those orphaned directories — leaving every home that still belongs to a real user untouched. (Maps to NIST AC-2 and 800-171 3.1.1.)
What you'll do
- Find every directory under /export/home whose owner UID has no /etc/passwd entry
- Record the sorted orphaned home paths to /root/answers/orphaned.txt
- Remove exactly the orphaned home directories, keeping the valid users' homes
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
