What data should one erase from log files, error messages etc., if posting them as a screenshot so as not to expose sensitive information?

To narrow down my question: What should a Linux User be extra aware of hiding if posting screenshots of logfiles, error messages, settings, etc.?

  • Is your question aimed at the private personal sector or the work-sector? – Nils May 14 '13 at 15:23
  • It would be nice to focus on what both private and personal sector do have in common. – erch May 15 '13 at 10:22

This is a broad ranging question and can probably only be answered with the same sorts of brushstrokes. Ultimately, it comes down to what you, the user, wish to protect.

Fundamentally, you should not post anything that would allow someone else to find it easier to compromise your system, or any of the other connected tools or accounts you use. For this reason you should consider:

  • Scrubbing any passwords from any material that you post
  • Obscuring your IP address
  • Changing details of ports you open to the net
  • Removing details about your ISP
  • Redacting your personal email address if you don't wish to attract (more) spam
  • Changing or removing hardware identifiers like MAC addresses

The real risk is not necessarily around the individual pieces of information (except, perhaps, in the case of your password—especially if it is one that you reuse, but you wouldn't do that, of course), but in the aggregate that some malefactor could piece together with some time and effort1.

Of course, it is not just about technology or your system; more broadly interpreted, there are other prophylactic measures you may wish to consider.

If you value your privacy, and that of your family, then you would want to take additional steps to ensure that only that personal information that you are comfortable with enters the public domain; for example your geographic location, full legal name, photograph or further identifying information could all constitute material that could be used for identity theft or other nefarious activity.

These other facets of information are unlikely to be included in screenshots or logfiles, but if they are already online through other means, such as social networking sites and the like, then it does increase the surface of vulnerability and, in any event, you should be conscious of that profile, at the very minimum.

1. Standard levels of paranoia being applied...

| improve this answer | |

The basic rule should be to expose only necessary information.

So here the basic security rules apply:

  1. Only as much access/information as needed
  2. Anything else should be forbidden/not readable

As you can see from many questions asked here - comments will ask for further information, if needed. But it is up to you to obfiscate personal information about individuals or about technical details not needed for this problem.

| improve this answer | |

Adding to the other two (great) answers, it's also good to realize that the process of factor separation, so important for good testing/troubleshooting, is somehow related to the act of removing the sensitive info.

In other words, whenever possible, always try to replicate your problem in a separate environment. Apart from the advantage of ruling out (which often eventually comes out as) irrelevant information and helping you find the root cause, it can also hide your production environment from the lab.

More specific examples:

  • create and use another testing account (don't forget to delete it afterwards)

  • if you have enough computing power, keep a testing virtual machine, or even a virtual network at hand and replicate the problem there. This can even give you huge advantage of snapshots.

  • under these environments, tend to name things like "foo", "bar", "me", "here". In many circumstances this will make it stand out that the information is of little or no value

By experimenting this way (while still respecting what is said in the other two posts), you'll find out that there is much less information that is relevant enough to actually need to be posted in the first place, and in turn that there is much less information that is left to hide.

| improve this answer | |

Just complement the other answers that show you what types of things to anonymize in logs I thought I'd provide a list of tools that can be used to help facilitate anonymizing the logs.


The list is primarily tools for dealing with tcpdump/pcap logs. NOTE: The full list of tools and libraries is here.

  • AnonTool
    • Netflow (v5 and v9) traces in tcpdump format or on live interfaces
  • CoralReef
    • network interfaces; DAG, FORE, and POINT capture cards; trace files in CoralReef (.crl), tcpdump/pcap, DAG (legacy and ERF), or TSH (.tsh) formats
  • ipsumdump
    • tcpdump/pcap, DAG (legacy and ERF), FR, FR+, TSH, ipsumdump (text), NetFlow summary (text), linux network device
  • SCRUB-tcpdump
    • tcpdump/pcap, network interface
  • tcpanon
    • tcpdump/pcap
  • tcpdpriv
    • tcpdump/pcap, network interface
  • tcpmkpub
    • tcpdump/pcap
  • TCPurify
    • tcpdump/pcap, network interface

Logging Frameworks


Splunk is a log file aggregator. Splunk aggregates system logs such as syslog into a centralized location where it can be analyzed. It provides a tool for anonymizing the data it's collected.

Running this tool works as follows:

./splunk anonymize file -source </path/to/filename>

The anonymize functionality is quite configurable, you can read more about it here.

syslog-ng You can actually use the logging framework, syslog-ng, itself to do the annonymization if it's data that should never be in the logs to begin with.

There's an interesting example of this here in this blog post titled: Linux: Anonymize IP logs with syslog-ng.

The idea is pretty simple:

Syslog-NG allows you to rewrite content using regular expressions. Add the following two rewrite rules to /etc/syslog-ng/syslog-ng.conf to replace IPv4 and IPv6 addresses by [REDACTED] and [REDACTED6]. (the regexp for IPv6 hasn't been tested extensively yet).

By using the rewrite and subst functionality built within syslog-ng you can do something like this:

rewrite r_ip {
"\[REDACTED\]", value("MESSAGE"), type("pcre"), flags("global"));
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.