โ† 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. Which file stores the encrypted password hashes for user accounts on a modern Linux system?

    Answer: /etc/shadow

    /etc/shadow stores encrypted password hashes and is readable only by root.

  2. What does the `-r` flag do when used with the `userdel` command?

    Answer: Removes the user's home directory and mail spool

    userdel -r removes the user account along with their home directory and mail spool.

  3. Which command would you use to lock a user account so they cannot log in?

    Answer: usermod -L username

    usermod -L locks the account by prepending a '!' to the password hash in /etc/shadow.

  4. What is the default UID assigned to the root user on Linux?

    Answer: 0

    Root always has UID 0, which grants it superuser privileges on the system.

  5. Which command displays the groups a specific user belongs to?

    Answer: groups username

    The `groups username` command lists all groups the specified user is a member of.

  6. What happens when you run `useradd username` without any additional options?

    Answer: Creates user with no home directory using system defaults

    By default, useradd without -m does not create a home directory unless configured otherwise in /etc/default/useradd.

  7. Which field in /etc/passwd specifies the user's login shell?

    Answer: Field 7

    The seventh (last) field in /etc/passwd specifies the user's default login shell path.