Thanks for your answers.
>> 3. When I login on a console or use the su - command I don't have the 
>> history of previous of the previous entered commands when I press the up or 
>> down arrow.
> 
> Right.  Leaving root's history file around is a security issue.   That
> behavior is controlled by:
> 
> if [ $EUID -eq 0 ] ; then
>         pathappend /sbin:/usr/sbin
>         unset HISTFILE
> fi
> 
> If you don't like it, just remove the unset command.
> 
>   -- Bruce

This part I don't think I understand.
If I login on a console or using su - this is true. The history dissapears 
after I log out.
But I have the file /root/.bash_history with all the commands I entered wile 
using su without the dash 
to work as root.

This I found on the web.

To limit the size and behaviour of the .bash_history file, you need to edit the 
behavior of the shell 
in the /etc/profile file (the central version of the .bash_profile file usually 
contained in users home directories). 
Add or change the following three lines to the file:

export HISTSIZE=100
export HISTFILESIZE=100
unset HISTFILE

The first two lines set the length and size of the history stored in the file. 
The last line unsets the HISTFILE variable that tells the Bash shell not 
to save history when the user logs out of the interactive session. 

This means an online user will only be able to see the history of the last 100 
commands, 
and that history will disappear after the user logs out of the host.

 A further way to ensure the command history is removed is to include a command 
in the .bash_logout file (other shells use the .logout file). The contents of 
the .bash_logout 
file are executed when the user logs out. You can see a simple .bash_logout 
file on the following lines:

# ~/.bash_logout

/bin/rm -f $HOME/.bash_history
clear

This looks like a nice addition to complete the security.

http://searchenterpriselinux.techtarget.com/tip/0,289483,sid39_gci1213815,00.html
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to