Remove all logs of all activities

I discovered my Fedora keeps logs of my activity, for example in ~/.bash_history.

How do I remove all the logs of all my activities?

As we have seen in your nvidia/wayland/chrome/webrtc post, logs can be useful to diagnose problems.

So, system logs, or the “journal” is good to have when diagnosing.
You could do

sudo journalctl --vacuum-time=1h 

and run that command once an hour (with a systemd timer).

If you want to entirely disable it (I would not do it), run:

 systemctl stop systemd-journald.service
 systemctl disable systemd-journald.service
 systemctl mask systemd-journald.service

moreover, there is the kernel ring buffer that collects kernel messages (dmesg), no experience how to disable it. The thing that first comes into my mind, after each reboot, using a script, you can clear the buffer: dmesg --clear, or with a timer (say hourly or daily).

Then, some programs, like bash, create a (command) history, you will have to go one by one and figure out how to disable logging.

(bash: echo 'set +o history' >> ~/.bashrc)

What is the objective here?

3 Likes

I would go a little stronger and say that often logs are necessary to diagnose problems.

If you can state clearly the goal of doing so it can be better defined as to how to meet your goals. System logs are kept of various sorts for many processes and reasons. Many are found in /var/log/. Your personal command history is usually in ~/.bash_history. Most system logs are not indicative of what the user has done, but only what the system has done and errors that have resulted.

Browser histories are usually under ~/.cache and those are cleared by using the browser itself to clear cookies, history, and such.

In other words, to avoid breaking things you need to be clear as to the purpose and the types of activity logs you want to vanish.

1 Like

In other words, to avoid breaking things you need to be clear as to the purpose and the types of activity logs you want to vanish.

I thought that, if I get a malware or my PC gets stolen, the attacker wouldn’t be able to see my previous activity, at least.

But yeah, if they get my PC while mounted and unencrypted, that would be the least of my problems.

But maybe I can get some protection from the malware?

Maybe if I type some password in cleartext in the terminal that gets logged.

I found an answer in BleachBit, which can be installed from the official repos

sudo dnf install bleachbit

I would add to what @augenauf and @computersavvy have said in that logs are critical in not only figuring out what happens when something goes wrong, but also in analyzing activity on your computer (both your own and also potential attacks/malware). If you are concerned about security, I’d go as far to say you are lowering your security by deleting logs very often.

What about when using the browser and logging in to some remote site, such as banking, shopping, forums, etc.? You are still sending the password and even if using https it is in clear text on your system.

While the idea is good, the logs are not the critical vector of attack. Any malware such as a key logger would not reveal itself in the logs nor would it realistically delay in sending any data found but would do so in real time.