LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Is .bashrc supposed to be cleaned at some point ? (https://www.linuxquestions.org/questions/linux-software-2/is-bashrc-supposed-to-be-cleaned-at-some-point-609785/)

Linux.tar.gz 12-29-2007 04:56 AM

Is .bashrc supposed to be cleaned at some point ?
 
I'm always troubled when, suddently, my bash history disappears.
So is it an automatic procedure ?

-----EDIT
Of course i made a mistake: i talk about .bash_history

unSpawn 12-29-2007 06:17 AM

The .bashrc is a file the shell can source, it is not your shell history. Regardless I don't know any package that wipes your ~/.bash_history by default. If this happens I'd make sure to check with other users (if any) and check login records (last, lastb) and system and daemon logs for anomalies.

wit_273 12-29-2007 06:41 AM

.bash_history stores the most recent 500 entries in the user shell. It can be edited manually be editing the ~/.bash_history file but should not be automatically cleaned out-- except for entries greater then 500. If you are finding your history to be emptied often I would be concerned about a rootkit, or a user who is doing something they are trying hide (which is potentially just as a bad as a rootkit).

As unSpawn said you should look at your logs and who has been logged in when--but this may prove difficult because if something malicious is going on log accuracy is suspect also. Start off by installing (if not already installed) chkrootkit and rkhunter (root kit hunter) Run both program and see if they find any problems. If they find a problem start there in your investigation as to what is going on but note that both programs have a level of false positives due to their purposes. The results should only be used as a start--don't delete files they find to be a problem without first investigating and verifying the problem.

Linux.tar.gz 12-29-2007 06:45 PM

Of course i made a mistake: i talk about .bash_history ...

It's not the first time i see this file cleaned on Slackware. Maybe, arrived to 500 commands, the file is blanked ?

Thanks for advices. I checked, but nothing seems suspicious.

sauce 12-29-2007 09:45 PM

thats not supposed to happen. please do this and reply with the output:

ls -l ~/.bash_history

i am looking to see ownership and permissions.

edit: this is what mine looks like.

-rw------- 1 sean users 8827 2007-12-29 16:11 /home/sean/.bash_history

Linux.tar.gz 12-31-2007 06:32 PM

-rw------- 1 joe users 10518 2008-01-01 01:30 /home/joe/.bash_history


All times are GMT -5. The time now is 07:15 AM.