Hints for obscuring personal info in config files when posting to the forum

I have spent way too much time trying to figure out how to save myself time obscuring my personal info from my config files. So I'm going to share what I found and then someone will say "why didn't you just do this really easy thing?"
I'm not an expert at this I just kept searching for examples and trying them until I found something that worked for me.
If you know a better way, please share.
If someone has written a script that automates the process I would love to hear about it.
Because going through line by line SUCKS!

In Notepad++, in find and replace, tic the box that says "Regular expression"
If you put in the find window [a-fA-F0-9]{2}(:[a-fA-F0-9]{2}){5} it will find all your mac addresses and you can replace it with whatever you want '#:#:#:#:#:#'

\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} will find all IP addresses

option name (.+) will find dhcp names and you can replace it with option name '****' or whatever your heart desire.
Same for option key (.+) to hide passwords.

1 Like

In a script to send to a bit bucket and post the link, or mod to put in a post:

sed 's/nameString//g' $1 | sed -E -e 's/[0-9a-fA-F:]{17}/11:22:33:44:55:66/' | nc termbin.com 9999

i.e. thisScript.sh myConfig

4 Likes

It is best to only redact/obfuscate public IP addresses. RCF1918 addresses do not reveal anything sensitive about your configuration, and removing/redacting/obfuscating them will actually make troubleshooting harder.

1 Like

good point