Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-30-2003, 09:07 AM   #1
LQ Newbie
Registered: Feb 2003
Location: UK
Distribution: Mandrake 9.0
Posts: 11

Rep: Reputation: 0
Wiping bash command history?

Hi all

I've just noticed how my password is stored as a bash command accessible via PgUp in a terminal (well, via Ctrl+Alt+F1 at least). I presume the command history can be deleted, but mine has many commands from weeks ago and I'm worried about the security implications. Sure, it's not like I have heaps of bank data or anything, but if I vanish to the bathroom there's a risk someone could get the password & leave no trace.

Old 07-30-2003, 12:28 PM   #2
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
If you wanna wipe out the history file (in BASH):
> .bash_history

If you wanna preserve some lines, you can do:
tail --lines=number .bash_history > .bash_history.tmp; mv   .bash_history.tmp .bash_history
But I don't know how you managed to get your passwords in you history file. Or maybe I just don't understand your problem.
Old 07-30-2003, 12:45 PM   #3
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
history -c
Old 07-30-2003, 02:33 PM   #4
LQ Newbie
Registered: Feb 2003
Location: UK
Distribution: Mandrake 9.0
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks lfur

I don't know how the password got there either, but it did. I'll try your stuff as soon as I get offline, and I might repost here if I find out how it occurred (if I can replicate the situation someone might have a prevention for it, rather than a cure...)



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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
history not working in bash subu_s AIX 2 12-29-2004 12:49 PM
bash history slowly Linux - General 2 11-12-2004 11:35 AM
F8 for command history in bash titanandrews Linux - General 7 10-15-2004 03:25 PM
Bash History ukndoit Linux - Security 2 10-16-2003 09:02 AM
bash command history problem crabboy Slackware 1 10-17-2002 07:55 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:10 PM.

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