System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit (remove) some entries from history of root user with out trace...

 
senthil_kumar_1
Super Advisor

How to edit (remove) some entries from history of root user with out trace...

Hi All,

 

How to edit (remove) some entries from history of root user with out trace...

2 REPLIES

Re: How to edit (remove) some entries from history of root user without trace...

I'm not sure why you would ever want to do this, unless it is for some nefarious purpose.

I suppose you may want to remove a password that was on a command line?

 

You can simply use vi.  I'm not sure if the file will be a valid history file after that, since the file is binary.

Of course if you have auditing enabled, then you may have that vi usage logged.

Bill Hassell
Honored Contributor

Re: How to edit (remove) some entries from history of root user with out trace...

The shell history kept by the POSIX shell, Korn shell or even bash is not 100% ASCII. There are binary characters kept in the file for positioning. If you delete or add any lines, the history will be non-functional. The only way to restore the history and recall function is to empty the file completely.



Bill Hassell, sysadmin