nerdexam
LPI

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.

Security and File Permissions

Question

What happens to a file residing outside the home directory when the file owner's account is deleted? (Choose two.)

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)
  • A
    6% (2)
  • B
    6% (2)
  • C
    75% (24)
  • D
    13% (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.

ADuring a file system check, the file is moved to /lost+found.

/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.

BThe file is removed from the file system.

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.

CThe UID of the former owner is shown when listing the file's details.Correct

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.

DThe user root is set as the new owner of the file.

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.

EOwnership and permissions of the file remain unchanged.Correct

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

#file ownership#user deletion#UID#orphaned files

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice