LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 02-15-2009, 12:00 PM   #1
Reasa
Member
 
Registered: Aug 2008
Distribution: Slackware
Posts: 53

Rep: Reputation: 16
root's .bash_history is zero size


Subject. This is on Slackware. What could cause this?
 
Old 02-15-2009, 12:09 PM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,492

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Maybe the history is deleted upon logout. Check if some clearing command has been put by default in /root/.bashrc or /root/.bash_logout. The command
Code:
# history -c
will delete the entire content of the history file, but other commands can do it as well:
Code:
# rm -f $HOME/.bash_history
# > $HOME/.bash_history
Also check if the environment variables related to history are correctly set up:
Code:
# set | grep HIST
 
Old 02-15-2009, 12:17 PM   #3
Reasa
Member
 
Registered: Aug 2008
Distribution: Slackware
Posts: 53

Original Poster
Rep: Reputation: 16
bash-3.1# set | grep HIST
HISTFILE=/root/.bash_history
HISTFILESIZE=500
HISTSIZE=500
bash-3.1#

.bashrc and .bash_logout are not present in /root/

Last edited by Reasa; 02-15-2009 at 12:23 PM.
 
Old 02-15-2009, 12:21 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,492

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Quote:
Originally Posted by Reasa View Post
bash-3.1# set | grep HIST
HISTFILE=/root/.bash_history
HISTFILESIZE=500
HISTSIZE=500
bash-3.1#
Ok. That's correct and should not prevent the history file to be populated. Have you checked in .bashrc and/or .bash_logout if you have some clearing command, as the ones suggested above?
 
Old 02-16-2009, 12:51 AM   #5
ayeomans
LQ Newbie
 
Registered: Jan 2006
Location: Tring, UK
Distribution: Ubuntu, Fedora, Xandros-EEE
Posts: 10

Rep: Reputation: 1
Filesystem full?

Can happen if the filesystem that root's home directory is in (probably "/") fills up.
 
Old 02-18-2009, 12:12 AM   #6
LaughingBoy
Member
 
Registered: May 2006
Location: Adelaide, South Australia
Distribution: Fedora 6-17 x64 / Ubuntu 10.x x64
Posts: 95

Rep: Reputation: 16
Never been logged into (as root) before?
 
Old 02-20-2009, 02:52 PM   #7
abefroman
Senior Member
 
Registered: Feb 2004
Location: Chicago
Distribution: CentOS
Posts: 1,256

Rep: Reputation: 53
I saw a hacked server one, where the hacker symlinked .bash_history to /dev/null
 
Old 02-21-2009, 05:46 AM   #8
Reasa
Member
 
Registered: Aug 2008
Distribution: Slackware
Posts: 53

Original Poster
Rep: Reputation: 16
Been logged as root, and its not symlinked. Nothing of deletion in /etc/profile too. I just cant believe i filled 500 history lines since reinstall, but if i did- would the file be cleaned to 0 bytes?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.bash_history question stakhous Linux - Newbie 1 05-24-2005 06:24 PM
.bash_history t3gah Linux - Software 2 05-05-2005 03:45 AM
Want to increase max size of .bash_history Tyir Slackware 4 01-19-2004 01:12 AM
bash_history linj Linux - Software 6 08-08-2003 10:13 AM
.bash_history gone togeno Linux - Security 3 06-30-2003 07:10 AM


All times are GMT -5. The time now is 09:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration