Attacks and Exploits
A tester with a non-root shell on a Linux host wants this session's typed commands left out of the user's saved shell history. Which action does that?
Show the answer
Correct answerD. Unset the shell's history file variable before exiting
AWhy not this: Altering timestamps hides when the file changed but leaves the recorded commands in it.
BWhy not this: Stopping rsyslog needs root and only halts system logging; shell history is written by the shell.
CWhy not this: The auth log is a system log needing root and holds no record of the user's typed commands.
DWhy this is right: With the history file variable unset, the shell has no file to save the session's commands to.
With no history file defined, the shell writes nothing to disk at exit, so the session's commands are not saved. Truncating the auth log or stopping rsyslog needs root and does not touch the per-user history file.