Question 30
A controlled command-line practice exercise reports: A trainee uses su to switch to another local account but assumes the current shell always retains their original effective user identity and home environment. Which supported corrective action most directly addresses the problem?
Explanation
Correct Answer
The main issue is: The su utility can start a shell under another account, so effective identity and login-environment details can differ from the caller's previous session. The appropriate correction is: Use an approved su invocation to enter the intended authorized account and inspect the resulting identity before running commands. Verify success by checking: An id check inside the resulting shell reports the selected account while the original user's shell remains accessible on exit.
Incorrect Answers
This action addresses root account privilege differs from standard user, whose causal condition is: A normal account and the root superuser have different default privileges, and protected system changes require authorized elevated access. The current scenario instead requires attention to: The su utility can start a shell under another account, so effective identity and login-environment details can differ from the caller's previous session.
This action addresses etc passwd accounts and shadow password hashes, whose causal condition is: The /etc/passwd database commonly exposes account names and IDs while protected password hashes belong in a more restricted /etc/shadow database. In this question the necessary remedy is “Use an approved su invocation to enter the intended authorized account and inspect the resulting identity before running commands”, which this alternative does not provide.
This action addresses sudo command elevation without root login, whose causal condition is: Sudo can authorize and log selected privileged commands under a named user account without distributing a shared root login secret. The observed condition is a trainee uses su to switch to another local account but assumes the current shell always retains their original effective user identity and home environment; this mechanism addresses another problem.