To align a workstation with a central directory you run `usermod -u 5001 frank`, changing frank's UID from 1001. He also owns files in /srv/data and a crontab under /var/spool/cron. What is the state of file ownership afterwards?

LPIC-1 Exam 102-500, objective 107. Administrative tasks hard

Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.

Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.

How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.

The options

Correct Files under frank's home directory that were owned by UID 1001 are re-owned to 5001 automatically; the files in /srv/data and his crontab under /var/spool/cron still record UID 1001 and must be changed by hand.

Correct. usermod re-owns what it finds inside the home directory named in the passwd entry, plus the user's mail spool. Everything outside those keeps the old numeric owner and now appears to belong to a UID with no account.

Not correct Every file on the system owned by UID 1001 is re-owned to 5001, because usermod walks the filesystem.

Wrong. usermod performs no filesystem-wide walk; on a large server that would take hours. Only the home directory is traversed.

Not correct No file anywhere is re-owned, including the home directory, because ownership is stored as a number and the number has not moved.

Wrong. The home directory is the deliberate exception: usermod re-owns files there so that the user can still read their own dotfiles after the change.

Not correct Ownership is unaffected everywhere, because the kernel resolves ownership through the login name rather than the UID.

Wrong on the mechanism. Inodes store a numeric UID; the login name exists only in /etc/passwd, and tools such as ls translate the number to a name for display.

Why

Ownership on disk is a number, so changing an account's UID orphans every file that number touched apart from the home directory and the mailbox, which usermod re-owns for you. The repair is a deliberate sweep — `find / -uid 1001 -exec chown 5001 {} +`, run before any new account can be allocated the vacated UID, because otherwise those files silently become readable by a stranger. `find / -nouser` afterwards shows what was missed, and files under /var/spool are a classic omission.

Where this comes from

Cited
manual page usermod(8)

Practise this

Reading one question is not practice. The trainer will draw a short set from objective 107 and space the ones you get wrong.

Practise LPIC-1 Exam 102-500

More questions on this objective

All questions on Administrative tasks

Practise LPIC-1 Exam 102-500