Question 370
In a Linux Essentials v1.6 practice lab, the learner observes: 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 underlying technical principle explains these observations?
Explanation
Correct Answer
The technical basis 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. Resolve this through: Use an approved su invocation to enter the intended authorized account and inspect the resulting identity before running commands. The expected evidence is: An id check inside the resulting shell reports the selected account while the original user's shell remains accessible on exit.
Incorrect Answers
The sticky bit on a shared writable directory restricts removal or renaming of entries by unrelated users, subject to ownership and privilege rules. “Use the appropriate sticky-bit directory permissions for an approved shared temporary directory without making all individual files public” would remedy that alternative situation, but it would not correct the present issue: 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.
“Use the approved administrative procedure under an authorized privileged identity rather than removing broad filesystem protections” is the supported response when a normal account and the root superuser have different default privileges, and protected system changes require authorized elevated access. Here the decisive response is “Use an approved su invocation to enter the intended authorized account and inspect the resulting identity before running commands”, so that different intervention does not meet the stated requirement.
Sudo can authorize and log selected privileged commands under a named user account without distributing a shared root login secret. “Run only the approved administrative command through sudo under the user's authorized policy rather than exposing root credentials” applies to that other condition. The reported evidence 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 alternative would address the wrong dependency.