what happens when bash_history reaches its limit? - Security

This is a discussion on what happens when bash_history reaches its limit? - Security ; What happens when bash_history reaches its limit? is it truncated back to zero or does it just lose the entries at the beginning on a rotating basis? Thanks, Kevin...

+ Reply to Thread
Results 1 to 13 of 13

Thread: what happens when bash_history reaches its limit?

  1. what happens when bash_history reaches its limit?

    What happens when bash_history reaches its limit?

    is it truncated back to zero or does it just lose the entries at the
    beginning on a rotating basis?

    Thanks,

    Kevin

  2. Re: what happens when bash_history reaches its limit?

    kevin bailey wrote:

    > is it truncated back to zero or does it just lose the entries at the
    > beginning on a rotating basis?


    This is correct. There are certain other instances were it wouldn't,
    but in most (pretty much all) cases it will.

    >
    > Thanks,
    >
    > Kevin


  3. Re: what happens when bash_history reaches its limit?

    kevin bailey writes:

    >What happens when bash_history reaches its limit?


    >is it truncated back to zero or does it just lose the entries at the
    >beginning on a rotating basis?


    Surely you have already entered more than a few hundred commands?
    The entries drop off the top end.


    >Thanks,


    >Kevin


  4. Re: what happens when bash_history reaches its limit?

    On Tue, 17 Oct 2006, in the Usenet newsgroup comp.os.linux.security, in article
    , kevin bailey wrote:

    >What happens when bash_history reaches its limit?


    man bash then enter the command /^HISTORY

    >is it truncated back to zero or does it just lose the entries at the
    >beginning on a rotating basis?


    [compton ~]$ history | head -4
    1334 grep FI stats/arin.new.date.diffs stats/ripe.new.date.diffs
    1335 grep 147.243.0 stats/arin.new.date.diffs stats/ripe.new.date.diffs
    1336 less stats/ripe.new.date.diffs
    1337 domain GF
    Broken pipe
    [compton ~]$ history | head -4
    1335 grep 147.243.0 stats/arin.new.date.diffs stats/ripe.new.date.diffs
    1336 less stats/ripe.new.date.diffs
    1337 domain GF
    1338 arinwhois 69.25.34.194
    Broken pipe
    [compton ~]$ history | head -4
    1336 less stats/ripe.new.date.diffs
    1337 domain GF
    1338 arinwhois 69.25.34.194
    1339 less ../scripts.new
    Broken pipe
    [compton ~]$ history | head -4
    1337 domain GF
    1338 arinwhois 69.25.34.194
    1339 less ../scripts.new
    1340 df
    Broken pipe
    [compton ~]$

    What do you think?

    Old guy

  5. Re: what happens when bash_history reaches its limit?

    Moe Trin wrote:

    > On Tue, 17 Oct 2006, in the Usenet newsgroup comp.os.linux.security, in
    > article , kevin bailey wrote:
    >
    >>What happens when bash_history reaches its limit?

    >
    > man bash then enter the command /^HISTORY
    >
    >>is it truncated back to zero or does it just lose the entries at the
    >>beginning on a rotating basis?

    >
    > [compton ~]$ history | head -4
    > 1334 grep FI stats/arin.new.date.diffs stats/ripe.new.date.diffs
    > 1335 grep 147.243.0 stats/arin.new.date.diffs stats/ripe.new.date.diffs
    > 1336 less stats/ripe.new.date.diffs
    > 1337 domain GF
    > Broken pipe
    > [compton ~]$ history | head -4
    > 1335 grep 147.243.0 stats/arin.new.date.diffs stats/ripe.new.date.diffs
    > 1336 less stats/ripe.new.date.diffs
    > 1337 domain GF
    > 1338 arinwhois 69.25.34.194
    > Broken pipe
    > [compton ~]$ history | head -4
    > 1336 less stats/ripe.new.date.diffs
    > 1337 domain GF
    > 1338 arinwhois 69.25.34.194
    > 1339 less ../scripts.new
    > Broken pipe
    > [compton ~]$ history | head -4
    > 1337 domain GF
    > 1338 arinwhois 69.25.34.194
    > 1339 less ../scripts.new
    > 1340 df
    > Broken pipe
    > [compton ~]$
    >
    > What do you think?
    >


    Can't really tell - but looks like it rotates.

    Kev

    > Old guy



  6. Re: what happens when bash_history reaches its limit?

    kevin bailey wrote:
    > Moe Trin wrote:


    >> [compton ~]$ history | head -4
    >> 1336 less stats/ripe.new.date.diffs
    >> 1337 domain GF
    >> 1338 arinwhois 69.25.34.194
    >> 1339 less ../scripts.new
    >> Broken pipe
    >> [compton ~]$ history | head -4
    >> 1337 domain GF
    >> 1338 arinwhois 69.25.34.194
    >> 1339 less ../scripts.new
    >> 1340 df
    >> Broken pipe
    >> [compton ~]$
    >>
    >> What do you think?

    >
    > Can't really tell - but looks like it rotates.


    It doesn't /rotate/ - it *FIFOes*.


    J. [sorry about the lexicophilia...]

  7. Re: what happens when bash_history reaches its limit?

    On 2006-10-18, kevin bailey wrote:

    > Can't really tell - but looks like it rotates.


    Nope. Like one poster said, FIFO. Why do you want to know? A
    security concern? Many consider .bash_history a security liability.
    One alternative is zsh, which purges history after each session.
    Another alternative is to create a chron job to do the same thing for
    bash.

    nb

  8. Re: what happens when bash_history reaches its limit?

    On 2006-10-18, notbob wrote:

    > Nope. Like one poster said, FIFO. Why do you want to know? A
    > security concern? Many consider .bash_history a security liability.
    > One alternative is zsh, which purges history after each session.
    > Another alternative is to create a chron job to do the same thing for
    > bash.


    Or just put "history -c" in your ~/.bash_logout script.

    --

    -John (john@os2.dhs.org)

  9. Re: what happens when bash_history reaches its limit?

    John Thompson writes:

    > On 2006-10-18, notbob wrote:
    >
    > > Nope. Like one poster said, FIFO. Why do you want to know? A
    > > security concern? Many consider .bash_history a security liability.
    > > One alternative is zsh, which purges history after each session.
    > > Another alternative is to create a chron job to do the same thing for
    > > bash.

    >
    > Or just put "history -c" in your ~/.bash_logout script.


    Or just "unset HISTFILE" in your .bashrc; from 'man bash':

    -> HISTFILE
    -> The name of the file in which command history is saved (see HIS-
    -> TORY below). The default value is ~/.bash_history. If unset,
    -> the command history is not saved when an interactive shell
    -> exits.

    --
    Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
    Dept. of Physics, Univ. of Padova, Italy ROT13: ybergv@cq.vasa.vg

  10. Re: what happens when bash_history reaches its limit?

    On 2006-10-19, John Thompson wrote:

    > Or just put "history -c" in your ~/.bash_logout script.


    You log out?

    nb

  11. Re: what happens when bash_history reaches its limit?

    On 2006-10-19, Maurizio Loreti wrote:

    > Or just "unset HISTFILE" in your .bashrc; from 'man bash':
    >
    > -> HISTFILE
    > -> The name of the file in which command history is saved (see HIS-
    > -> TORY below). The default value is ~/.bash_history. If unset,
    > -> the command history is not saved when an interactive shell
    > -> exits.


    The beauty of *nix. Ask one question, get ten answers ...that all work!

    nb

  12. Re: what happens when bash_history reaches its limit?

    On Tue, 17 Oct 2006 11:34:17 +0100, kevin bailey wrote:

    > What happens when bash_history reaches its limit?
    >
    > is it truncated back to zero or does it just lose the entries at the
    > beginning on a rotating basis?
    >
    > Thanks,
    >
    > Kevin


    .... you would rather ask than test it yourself?

    $ HISTSIZE=10
    $ cmd1
    $ cmd2
    $ cmd3
    $ cmd4
    $ cmd5
    $ cmd6
    $ cmd7
    $ cmd8
    $ cmd9
    $ cmd10
    $ cmd11
    $ cmd12
    $ cmd13
    $ history
    6 cmd5
    7 cmd6
    8 cmd7
    9 cmd8
    10 cmd9
    11 cmd10
    12 cmd11
    13 cmd12
    14 cmd13
    15 history
    .... first in first out... it keeps the last HISTSIZE commands
    including the current command (that you used to check your history)

    cat $HISTFILE
    cmd6
    cmd7
    cmd8
    cmd9
    cmd10
    cmd11
    cmd12
    cmd13
    history
    exit
    .... I tested that one for you too... same result

  13. Re: what happens when bash_history reaches its limit?

    On Thu, 19 Oct 2006 03:05:50 +0000, John Thompson wrote:

    > On 2006-10-18, notbob wrote:
    >
    >> Nope. Like one poster said, FIFO. Why do you want to know? A
    >> security concern? Many consider .bash_history a security liability.
    >> One alternative is zsh, which purges history after each session.
    >> Another alternative is to create a chron job to do the same thing for
    >> bash.

    >
    > Or just put "history -c" in your ~/.bash_logout script.
    >


    Or
    HISTFILE=/dev/null
    or
    HISTFILESIZE=0

+ Reply to Thread