Question 200
An existing employee should be assigned a new home directory path and existing home contents should move too. Which command combination fits?
- usermod -d /home/new -m sam
- groupmod -n platform devops
- userdel -r formeruser
- chage -d 0 sam
- usermod -e 2026-12-31 tempuser
Explanation
Correct Answer
A:usermod -d changes the recorded home location and -m moves content when supported. Permissions and destination existence must be checked.
Incorrect Answers
B:groupmod -n changes the local group name while preserving its identity number; it does not deliver moving a user's home and updating the account record, which is decisive in this scenario.
C:userdel -r removes the account and associated home and mail spool when supported; the evidence calls for moving a user's home and updating the account record, not merely this separate operation.
D:chage -d 0 marks the password as requiring change at next password-based login; the task involves moving a user's home and updating the account record, whereas this addresses another subsystem.
E:usermod -e sets the account's expiration date in the local account database; its scope differs from moving a user's home and updating the account record, so it cannot meet the stated requirement.
Question 201
An account's supplementary groups must be found from local group memberships. Which file records the named groups and member lists?
- /etc/shadow
- /etc/passwd
- /etc/group
- /etc/skel
Explanation
Correct Answer
C:/etc/group maps group names to GIDs and lists members for local group records. Primary group relationships are additionally defined in account entries.
Incorrect Answers
A:/etc/shadow stores password hashes and aging controls with restricted access; that is not equivalent to inspecting group identity and membership records.
B:/etc/passwd holds local account records with identity fields and login shell; the administrator instead needs inspecting group identity and membership records; this option serves a different purpose.
D:Account-creation utilities can copy skeleton-directory contents into a newly created home; that changes a different part of the system; the requested outcome is inspecting group identity and membership records.
Question 202
A global shell environment must be set for typical interactive login shells. Which system-level file is commonly sourced?
- /etc/profile
- /etc/group
- /etc/shadow
- /etc/skel
Explanation
Correct Answer
A:/etc/profile establishes system-wide login-shell environment defaults for Bourne-style shells. Its exact use depends on the login shell and startup path.
Incorrect Answers
B:/etc/group maps group names to GIDs and lists members for local group records; using it would leave configuring system-wide login shell defaults unresolved.
C:/etc/shadow stores password hashes and aging controls with restricted access; the requirement is configuring system-wide login shell defaults, outside the effect of this choice.
D:Account-creation utilities can copy skeleton-directory contents into a newly created home; it does not deliver configuring system-wide login shell defaults, which is decisive in this scenario.
Question 203
An administrator wants the login shell for an existing user changed to /bin/bash. Which command performs it?
- groupadd auditors
- adduser newstaff
- usermod -aG docker sam
- usermod -s /bin/bash sam
Explanation
Correct Answer
D:usermod -s updates the shell entry in the account database. A permitted shell and login restrictions still determine whether an interactive session can start.
Incorrect Answers
A:groupadd registers a local group in the system account database; the task involves updating an existing account's login shell, whereas this addresses another subsystem.
B:Debian's adduser utility commonly wraps lower-level account creation with interactive prompts and defaults; its scope differs from updating an existing account's login shell, so it cannot meet the stated requirement.
C:The -aG combination appends a supplemental group to the user's existing list; that is not equivalent to updating an existing account's login shell.
Question 204
A Debian-derived system offers a higher-level interactive helper that can configure a new user's password. Which command is commonly available?
- useradd -r -s /usr/sbin/nologin svcapp
- usermod -aG docker sam
- adduser newstaff
- useradd -m -d /home/deploy deploy
Explanation
Correct Answer
C:Debian's adduser utility commonly wraps lower-level account creation with interactive prompts and defaults. It is not a universal syntax across all Linux families.
Incorrect Answers
A:A system-style account combined with a non-login shell helps isolate service execution; that changes a different part of the system; the requested outcome is interactively provisioning an account on Debian.
B:The -aG combination appends a supplemental group to the user's existing list; this does not achieve interactively provisioning an account on Debian on the system described.
D:useradd creates the account, while -m requests creation of its home and -d selects the path; using it would leave interactively provisioning an account on Debian unresolved.
Question 205
A service account needs its primary group changed to svcops without modifying supplementary memberships. Which operation is appropriate?
- passwd -l contractor
- usermod -e 2026-12-31 tempuser
- usermod -g svcops svcuser
- chage -d 0 sam
Explanation
Correct Answer
C:usermod -g assigns a primary group to the account. It does not necessarily rewrite ownership of existing files to the new GID.
Incorrect Answers
A:passwd -l locks password authentication by modifying the stored password field; it does not deliver changing the primary GID of an existing account, which is decisive in this scenario.
B:usermod -e sets the account's expiration date in the local account database; the evidence calls for changing the primary GID of an existing account, not merely this separate operation.
D:chage -d 0 marks the password as requiring change at next password-based login; its scope differs from changing the primary GID of an existing account, so it cannot meet the stated requirement.
Question 206
An account audit must read the local UID and login-shell mapping AND protected password-aging records. Which TWO files normally hold those separate records? Choose TWO.
- /etc/shadow
- /etc/group
- /etc/passwd
- /etc/profile
- /etc/skel
Explanation
Correct Answers
A:/etc/shadow protects password hashes and aging-policy values using restricted permissions, unlike the public account identity fields in /etc/passwd. The two files therefore serve different halves of the requested local account audit.
C:/etc/passwd holds local account records with identity fields and login shell. Password hashes are normally kept separately in shadow data.
Incorrect Answers
B:/etc/group maps group names to GIDs and lists members for local group records; it answers a neighboring question rather than examining public account identifiers and protected password policy.
D:/etc/profile establishes system-wide login-shell environment defaults for Bourne-style shells; this does not achieve examining public account identifiers and protected password policy on the system described.
E:Account-creation utilities can copy skeleton-directory contents into a newly created home; it will not provide examining public account identifiers and protected password policy under these conditions.
Question 207
A user account requires a specific numeric UID at creation for an NFS ownership migration. Which option controls it?
- adduser newstaff
- usermod -aG docker sam
- useradd -m -d /home/deploy deploy
- useradd -u 2205 account
Explanation
Correct Answer
D:The -u argument chooses the new account's numeric UID, provided it is valid and available. Numeric ownership matters across NFS and restored files.
Incorrect Answers
A:Debian's adduser utility commonly wraps lower-level account creation with interactive prompts and defaults; using it would leave assigning an explicit UID at account creation unresolved.
B:The -aG combination appends a supplemental group to the user's existing list; the requirement is assigning an explicit UID at account creation, outside the effect of this choice.
C:useradd creates the account, while -m requests creation of its home and -d selects the path; it does not deliver assigning an explicit UID at account creation, which is decisive in this scenario.
Question 208
A new account called deploy requires a specific home directory to be created. Which Linux command makes the account and populates the home?
- useradd -r -s /usr/sbin/nologin svcapp
- useradd -m -d /home/deploy deploy
- usermod -aG docker sam
- groupadd -g 4500 media
- useradd -u 2205 account
- adduser newstaff
Explanation
Correct Answer
B:useradd creates the account, while -m requests creation of its home and -d selects the path. Distribution defaults vary, so explicit flags matter.
Incorrect Answers
A:A system-style account combined with a non-login shell helps isolate service execution; its scope differs from provisioning a named account with its home directory, so it cannot meet the stated requirement.
C:The -aG combination appends a supplemental group to the user's existing list; the administrator instead needs provisioning a named account with its home directory; this option serves a different purpose.
D:groupadd -g sets a particular local group ID if it is not already used, unless explicit nonunique behavior is allowed; it answers a neighboring question rather than provisioning a named account with its home directory.
E:The -u argument chooses the new account's numeric UID, provided it is valid and available; that changes a different part of the system; the requested outcome is provisioning a named account with its home directory.
F:Debian's adduser utility commonly wraps lower-level account creation with interactive prompts and defaults; this does not achieve provisioning a named account with its home directory on the system described.
Question 209
Administrators need to create a new group named auditors. Which command does that?
- usermod -aG docker sam
- useradd -r -s /usr/sbin/nologin svcapp
- groupadd auditors
- useradd -m -d /home/deploy deploy
Explanation
Correct Answer
C:groupadd registers a local group in the system account database. Creating a group alone does not grant access to any particular file.
Incorrect Answers
A:The -aG combination appends a supplemental group to the user's existing list; this does not achieve creating a local supplementary group on the system described.
B:A system-style account combined with a non-login shell helps isolate service execution; it will not provide creating a local supplementary group under these conditions.
D:useradd creates the account, while -m requests creation of its home and -d selects the path; the requirement is creating a local supplementary group, outside the effect of this choice.
Question 210
A single PID's CPU consumption over time needs to be sampled rather than averaged across all processes. Which command fits?
- pidstat -p 6120 1
- pstree -p
- /proc/6120/
- ps aux
Explanation
Correct Answer
A:pidstat measures per-process statistics at intervals and can target a specific PID. It is useful for correlating a named process with a resource spike.
Incorrect Answers
B:pstree presents processes as a hierarchy and -p includes PIDs; the task involves sampling one process's CPU statistics, whereas this addresses another subsystem.
C:The procfs PID directory contains process-specific pseudo-files such as status and cmdline; its scope differs from sampling one process's CPU statistics, so it cannot meet the stated requirement.
D:ps aux displays a system-wide process snapshot including user, CPU and memory information; that is not equivalent to sampling one process's CPU statistics.