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
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.
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.
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.
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.
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.
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.
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.