2
1
Having a bash history enabled is a security risk, because when you accientally enter your password into the bash the password gets stored in the bash history. To prevent this a good solution would be to configure the bash history not to save commands that were'nt found in $PATH.
So far this is how i setup the history behaviour
# Dont Save duplicated history lines
HISTCONTROL=irgnoredups:erasedups
HISTTIMEFORMAT="%F-%M-%S --> "
HISTIGNORE="su":"su *":"sudo *":"sudo":"his":"his *":"history":"history *":"halt":"reboot":"apt-get *":"apt-cache *":"aptitude *":"dpkg *"
# need a bigger history
# uncomment these lines
#HISTSIZE=1000000
#HISTFILESIZE=1000000
It there a way to setup the history so it would only store commands that are in path?
umm.. that's the opposite of what you want, isn't it? – Ярослав Рахматуллин – 2012-12-06T17:21:53.703
yes it is. but i think this might not be solved that easy. it seems that i need a backgroud process or something looking whether the command is in $PATH or not. but thanks anyway – l1zard – 2012-12-06T17:30:37.957