101-350 · Question #123
When a new user is added, where does his user ID gets stored?
The correct answer is E. /etc/passwd. See the full explanation below for the reasoning.
Question
Options
- A/etc/users
- B/etc/realm
- C/etc/pass
- D/etc/shpasswd
- E/etc/passwd
How the community answered
(29 responses)- A3% (1)
- B10% (3)
- C3% (1)
- D3% (1)
- E79% (23)
Community Discussion
6The correct answer is E, /etc/passwd. This file is the canonical store for local user account information on Linux and Unix systems, and every new user created with useradd or adduser gets a new entry written there. Each line holds seven colon-separated fields: username, password placeholder (the x tells you the actual hash lives in /etc/shadow), UID, GID, GECOS comment, home directory, and login shell. The other options are all fabricated paths, none of them exist as standard Linux files, which makes this a good card to pair with a fill-in-the-blank on the field order so you remember the full structure, not just the filename.
E is right, /etc/passwd is where the user ID (UID) and other account info like the username, home directory, and default shell get stored as a colon-separated entry the moment you run useradd. The other options are made up, none of them exist on a real Linux system.
E is right, though D trips people up since /etc/shadow is real.
Right, and what helped it click for me is remembering that /etc/shadow exists specifically because /etc/passwd has to be world-readable, so they had to move the hashes somewhere only root can touch.
Got this exact one on my practice run last week and almost second-guessed myself because I kept mixing up the file name with "password" thinking it was only for passwords, but my study group reminded me that /etc/passwd is the whole user account database, UID included. Once that clicked I never missed it again.
The UID-to-username mapping is the part worth drilling separately on a card, because the exam loves to test whether you know field order in that colon-delimited structure, not just which file it lives in.