← All Linux Flashcard Decks

User Management Flashcards

7 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 User Management flashcards as text
  1. What numeric UID range is typically reserved for system accounts on Linux?

    Answer: 0–499 or 0–999 depending on distro

    System accounts typically use UIDs below 500 (Red Hat/CentOS) or below 1000 (Debian/Ubuntu), with regular users starting above that threshold.

  2. Which file must be edited to change the default shell for new users created with useradd?

    Answer: /etc/default/useradd

    /etc/default/useradd contains defaults like SHELL, HOME prefix, and SKEL path used by useradd.

  3. A user's account is locked. Which command unlocks it?

    Answer: Both A and B

    Both `passwd -u` and `usermod -U` unlock a locked account by removing the '!' prefix from the password hash.

  4. What does the `getent passwd username` command do?

    Answer: Fetches user account information from all configured name service databases

    getent queries the Name Service Switch (NSS) databases including /etc/passwd, LDAP, and NIS for the specified user.

  5. Which command renames the user 'bob' to 'robert' and also renames their home directory?

    Answer: usermod -l robert -m -d /home/robert bob

    usermod -l changes the login name, -d sets the new home path, and -m moves the existing home directory contents.

  6. What does the GECOS field in /etc/passwd typically store?

    Answer: User's full name and contact information

    The GECOS field (field 5) stores user information like full name, office, phone number, separated by commas.

  7. Which command forces a user to change their password at next login?

    Answer: Both A and B

    Both `passwd -e` and `chage -d 0` expire the password immediately, forcing a change at next login.