User & Permission Management Flashcards
7 cards from real LCA 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 & Permission Management flashcards as text
Which command displays the numeric UID and GID of the current user along with all supplementary group memberships?
Answer: id
The id command shows the current user's UID, primary GID, and all supplementary group IDs.
What does the command 'newgrp developers' accomplish?
Answer: Starts a subshell with developers as the effective primary group
newgrp opens a new shell session where the specified group becomes the user's effective primary group for that session.
Which useradd option specifies a comment (GECOS field) such as the user's full name?
Answer: -c
The -c option sets the GECOS/comment field, typically used for the user's full name or description.
A file has permissions 664. What is the symbolic equivalent for the 'others' portion?
Answer: r--
The last octal digit 4 equals binary 100, which maps to read-only (r--).
Which file defines default settings (like UMASK and home directory skeleton path) used by useradd?
Answer: /etc/default/useradd
/etc/default/useradd stores defaults for the useradd command such as SHELL, HOME, INACTIVE, and EXPIRE.
What effect does setting UMASK to 027 have on newly created files?
Answer: Files get permissions 640
A umask of 027 subtracts from the default 666 for files: 666 - 027 = 640 (rw-r-----).
Which command is used to add an existing user 'alice' to the supplementary group 'sudo' without removing her from other groups?
Answer: usermod -aG sudo alice
usermod -aG appends the specified group to the user's supplementary groups; omitting -a would replace all supplementary groups.