1

Can't find them, there's no .bash_history. Also checked at /var/log/audit and /var/log/secure* Maybe they don't even exist or are disabled.

Thanks!

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
Rancor
  • 43
  • 1
  • 1
  • 7

1 Answers1

0

It sounds like the history file for root isn't being set. You can confirm this by running:

echo $HISTFILE

from your root shell. You can set this in the .bashrc in the /root (the home dir for the root user) by placing the line:

HISTFILE="/root/.bash_history"

at the end of your .bashrc file.

Note - The reason your history for the current session is viewable using

history

is because the bash history isn't actually written to the history file that is configured for that user until the user exits their session or it's terminated.

frontsidebus
  • 496
  • 2
  • 7
  • 1
    It's there, but only has the history for the session. Would look for a quick workaround to get a persisten file and post it in here, for me, it's super useful, like when I create kubernetes cluster with options, re using commands saves me lots of time. – Rancor Jul 06 '18 at 21:55