Secure erase and clean up programme

Hi guys,

Wondering if there’s a programme out there which I can use as an “all-in-one” security programme which can delete files securely (ie erase), clear all personal data such as browser information, any software temp files and p2p information, wipe the free space on the hard disk etc?

On Windows I use cyberscrub which has proven to be very good, is there anything like this on Linux?

Also… To do a general clear up of any temp files what’s the best way of doing this? Is it simply a case of opening a console as su and typing “rm /tmp*”?

Many thanks in advance

Ross

To empty the directories /tmp and /var/tmp at boot, first make a copy (as root of course):

cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfiles.d/tmp.conf

This second file’s contents will then be used instead of the first one (that you should not change because it may be overwritten at updates).

I changed two lines that you will find there into:

D /tmp 1777 root root 1d
D /var/tmp 1777 root root 1d

And, as the file says, read the documentation:

man tmpfiles.d

Another way to empty /tmp is to make it a tmpfs (in RAM). It will then vanish at shutdown.

Entry in /etc/fstab example

tmpfs	/tmp	tmpfs 	size=25%,uid=root,gid=root,mode=1777 0 0

Great answers from Henk, as always, of course.

Personally, though, I like to cold boot to a root console and manually clear /tmp and /var/tmp. I do this so I can keep an eye on what is going on in there. Sometimes, it gets quite interesting.

Thanks for the replies guys, I’ll give those a go. I did find a programme which appears to be very good called “bleachbit” which seems to do pretty much exactly what I’m after!

Have any of you heard of it?

Yep, heard of it, but I don’t use it. But before you continue, I would have expected the classic “Linux is not Windows” meme here already. A huge difference is that linux programs do no dump all kinds of redundant files all over a system.

To safely remove a specific file, I use “shred”, as in

shred -u filename

Beyond that, I typically install to an encrypted LVM. So I don’t much worry about free disk space, since it is all encrypted.

In situations where I cannot encrypt everything, I at least encrypt “/home”. And I usually also encrypt swap, and then set up “/tmp” to be mounted from swap (or tmpfs).