NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bash: clean history on logout?



On Thu, Sep 1, 2011 at 6:16 PM, Pierre-Philipp Braun
<pbraun%nethence.com@localhost> wrote:
> Quoting feralert 01/09/2011 17:45,
>>
>> On Thu, Sep 1, 2011 at 5:42 PM, Ian D. Leroux 
>> <idleroux%fastmail.fm@localhost>
>> wrote:
>>>
>>> On Thu, 01 Sep 2011 16:43 +0200, "feralert" <feralert%gmail.com@localhost> 
>>> wrote:
>>>>
>>>> I have a NetBSD 4.0 machine (a few actually) I have taken over from
>>>> someone lately that doesn't keep bash history from one session to
>>>> another.
>>>>
>>>> What i have tried so far is:
>>>>
>>>> - Check .bash_history is a regular file (not a link)
>>>>    # ls -l .bash_history
>>>>    -rw------- 1 root wheel 10282 Sep  1 12:26 .bash_history
>>>>
>>>> - And that the HISTFILE var points to the right file
>>>>     # echo $HISTFILE
>>>>     /root/.bash_history
>>>>
>>>> - looked for .bash_logout, but it doesnt exits.
>>>>
>>>> - checked in crontab but there is nothing there.
>>>>
>>>>
>>>> I don't know where else to look so any help would be appreciated.
>>>
>>> From bash(1):
>>> HISTFILESIZE
>>>   The maximum number of lines contained in the history file. When this
>>>   variable is assigned a value, the history file is truncated, if
>>>   necessary, to contain no more than that number of lines. The default
>>>   value is 500. The history file is also truncated to this size after
>>>   writing it when an interactive shell exits.
>>>
>>> Setting HISTFILESIZE to 0 might therefore do what you describe seeing.
>>>
>>> --IDL
>>>
>>
>> Sorry, I forgot to add it to the 'tried things' list:
>>
>> # set | grep -i hist
>> HISTFILE=/root/.bash_history
>> HISTFILESIZE=500
>> HISTSIZE=500
>>
>> SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
>
> Maybe he clears the history before exiting manually or through the logout
> script (history -c on bash).  In fact it's quite a good practice in some
> situations e.g. delivery.  But if you're working as a team you should
> probably ask him to stop that, or even better, keep track of the changes
> somewhere, (/root/README is you don't like corporate papers...).
>

Yes I though of that at first (cleaning it manually) but now he's been
gone for a few days (we're not a team, he resigned) and it keeps
happening. Thats also why i ask if this is a regular security measure
or he's just done it so i couldn't keep track of what he's been doing.


Home | Main Index | Thread Index | Old Index