Skip to content

Security Admin Tip- Enable terminal history logging

Lazy Linux admins should enable below history logging.

Santhosh Baswa

22 November 2016, 1 min read

Most of the times, When i was handling some IR investigations, I found some missing part and important artifacts in Linux machines. As a DFIR investigator, we do timeline analysis and look at malicious command execution history in linux machines.

But most of the lazy linux administrators were not enabling the history logging with date in linux machines. We don't see those command logging capabilities in most of the organisations, It will be very challenging for DFIR investigators while handling the incidents.

I would like to share some quick tip for all lazy linux administrators.

Bash command history date logging configuration

$ echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile
$ cat ~/.bash_profile
$ source ~/.bash_profile
$ history

Written by

Santhosh Baswa

I hunt and defend organisations’ environments, and in my free time I write up what I learn here and give technical sessions in open security communities.

Get new articles by email

One email when something substantial goes up. No tracking pixels, and one click to unsubscribe.