Securing History File

I’ve set some different options to securing the history file in comparison with the original document.

data=`date +%EY%m%d_%H%M%S`
control=`who -m |tr -s ‘_’ ‘!’ |tr -s ‘ ‘ ‘_’|tr -s ‘ ‘ ‘_’|tr -s ‘(‘ ‘_’ |tr -s ‘)’ ‘_’ |cut -d ‘_’ -f 1,6 | tr -s ‘!’ ‘_’`

HISTFILE=/var/tmp/history/sh_history_$control.$data
HISTSIZE=100000000000000000
HISTFILESIZE=10000000000000000
readonly HISTFILE
readonly HISTSIZE
readonly HISTFILESIZE
export HISTFILE HISTSIZE HISTFILESIZE

Hope this can help!

Pubblicato da antenore

I'm a free software addicted and an IT senior consultant, married, father and a funny friend

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.