010-160 · Question #76
What happens to a file residing outside the home directory when the file owner's account is deleted? (Choose two.)
The correct answer is C. The UID of the former owner is shown when listing the file's details. E. Ownership and permissions of the file remain unchanged. This question tests understanding of how Linux handles file ownership metadata when a user account is deleted, given that Linux filesystems store ownership as a numeric UID.
Question
Options
- ADuring a file system check, the file is moved to /lost+found.
- BThe file is removed from the file system.
- CThe UID of the former owner is shown when listing the file's details.
- DThe user root is set as the new owner of the file.
- EOwnership and permissions of the file remain unchanged.
How the community answered
(32 responses)- A6% (2)
- B6% (2)
- C75% (24)
- D13% (4)
Why each option
This question tests understanding of how Linux handles file ownership metadata when a user account is deleted, given that Linux filesystems store ownership as a numeric UID.
/lost+found is used by fsck to recover orphaned inodes caused by filesystem corruption or improper unmounting, not for files whose owner's account has been deleted.
Deleting a user account with userdel only removes the account entry and optionally the home directory; it does not delete files owned by that user elsewhere on the filesystem.
Linux filesystems store file ownership as a numeric UID, not a username string. When the user account is deleted, the UID no longer maps to a name in /etc/passwd, so tools like ls -l display the raw numeric UID instead of a username.
Linux does not automatically reassign orphaned file ownership to root when a user account is deleted - the original UID value is preserved in the inode unchanged.
Deleting a user account does not alter the inode metadata of files outside the home directory - the UID, GID, and permission bits stored in the inode remain exactly as they were before the account was deleted.
Concept tested: File ownership persistence after user account deletion
Source: https://man7.org/linux/man-pages/man8/userdel.8.html
Topics
Community Discussion
No community discussion yet for this question.