How to hide/anonymise/defend a computer when on hostile networks

networkingprivacySecurityservices

I connect to a lot of open networks when I'm pootling around. I'm fairly careful to VPN home for anything important but that's not really my boggle. The laptop runs several services (nfs, dev http server, samba, avahi).

Not only do I not want people on open networks connecting to these services, some of them (samba and avahi) are extremely slutty and advertise themselves all over the place to other computers.

I also don't want my computer name available in public places. I already rotate random MAC addresses so hotspot owners can't track where I go on a day-to-day basis. Yeah, I'm pretty paranoid sometimes.

Is there any way I can stop these services communicating (either way) on any network that isn't home?

Best Answer

This sounds like a job for dramatic pause, Iptables!

You can drop packets for those services using the OUTPUT chain, and can use the INPUT chain to block people from communicating with these services while still allowing yourself to communicate with them (eg. Via loopback address).

There are enumerable howto's and documentation pages out there about configuring Iptables, so I won't go into extensive detail here.

Related Question