LinuxBasics.org

The community that helps people to run Linux

rss
Table of Contents

Rewrite History!

“Oops, I just typed my password to the command-line!”
Yes. It happened to me. It was even the root-password. And since I feel unconfortable with that in a file on my disk, here is what I did to get rid of it:

Case 1: Not logged out, yet

In this case a simple “history -r” should do it, since it has not been written to disk, yet. I would log out & in after that and check in “~/.bash_history” just to be sure.

Case 2: Logged out, history has been saved

  1. edit “~/.bash_history”: Delete all lines containg the password
  2. remove the editor’s backup (“rm ~/.bash_history~” for emacs)
  3. re-read the modified history using “history -r”
  4. log out & in after that and check in “~/.bash_history” just to be sure.

Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.


Linux® is a registered trademark of Linus Torvalds.


 
  tutorials/advanced/realworld/sensitive_data_in_history.txt · Last modified: 2008/07/20 19:08

LinuxBasics.org

Start Linux-Course Tutorials Linux Links Security Blog Forum E-mail List Search Online Chat

Site-Info

Help Get in Touch Making of LBo

Wiki-Control

Powered by

Linux Apache DokuWiki Mailman RUTE ht://Dig