Linux wiping SSH history bash_history - clearing tracks

Asphyxia

Owner
Administrator
Apr 25, 2015
1,844
2
2,197
327
If you want to copy/paste this into root, this will wipe your root out if you went in through sudo - then the next user.. basically copy below and right click, right click:
Code:
cat /dev/null > ~/.bash_history && history -c && exit


There is also this, which is similar, but not quite.
Code:
cat /dev/null > .bash_history; history -c

Now also keep in mind:
Code:
cd /home/;ls

You could also clear all user activity, by:
Code:
su <username>

Then run:
Code:
cd ~
cat /dev/null > .bash_history; history -c
exit

Keep repeating through all users.

That could also be automated, cba to write that atm.

RIP logs
 
Last edited:

Asphyxia

Owner
Administrator
Apr 25, 2015
1,844
2
2,197
327
P.S. Why would you want to do this?

If you are reviewing your history logs regularly and seeing no problems, wiping logs is perfectly fine. There is less noise to sift through if something goes crazy, also you can know within a minute if someone else is on your system:
 
Top