← 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 is the effect of setting a user's shell to `/sbin/nologin`?

    Answer: Prevents the user from getting an interactive login shell

    /sbin/nologin is a placeholder shell that prints a message and exits, preventing interactive logins while allowing other service authentications.

  2. Which command shows the password aging information for a user named 'carol'?

    Answer: chage -l carol

    chage -l displays password aging details including last change, expiry, and warning dates for the specified user.

  3. When using `visudo`, what is the correct syntax to allow user 'dave' to run all commands as root without a password?

    Answer: dave ALL=(ALL) NOPASSWD: ALL

    The NOPASSWD: keyword in the sudoers rule skips password prompting for the specified commands.

  4. What does the `pwck` command do?

    Answer: Verifies the integrity of /etc/passwd and /etc/shadow files

    pwck validates /etc/passwd and /etc/shadow for consistency, detecting duplicate UIDs, missing home directories, and format errors.

  5. Which command would delete the group 'contractors' from the system?

    Answer: groupdel contractors

    groupdel removes the specified group from /etc/group and /etc/gshadow.

  6. What is the minimum number of days between password changes controlled by in /etc/shadow?

    Answer: Field 4 — minimum password age

    The fourth field in /etc/shadow sets the minimum number of days a user must wait before changing their password again.

  7. A system administrator wants to list all users currently logged into the system. Which command provides this?

    Answer: who

    The `who` command shows all users currently logged in, including their terminal and login time.