Jan 122014
 

In order to setup eternal bash history for all users:

vim /etc/bashrc

insert

if [ "$BASH" ]; then
        export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
        export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "("$ORIGINAL_USER")" "COMMAND: " "$(history 1 | cut -c8-)" >> /var/log/bash_eternal_history'
        alias ehistory='cat /var/log/bash_eternal_history'
        readonly PROMPT_COMMAND
        readonly HISTSIZE
        readonly HISTFILE
        readonly HOME
        readonly HISTIGNORE
        readonly HISTCONTROL
fi

Then as root run the commands:

# touch /var/log/bash_eternal_history
# chmod 777 /var/log/bash_eternal_history
# chattr +a /var/log/bash_eternal_history
Share This!
 Posted by at 1:48 pm

Sorry, the comment form is closed at this time.