Fired up on firewalls
So while we'll get round to better protecting services running on those ports we absolutely need, we can also create access controls using a basic firewall and, for that, let's consider two options:
The first is the common-or-garden iptables solution, a packet filtering framework with which we manage rules from the command line
The second is ConfigServer, the open source GUI that bundles its firewall with intrusion detection and analysis features and which, by chance, works nicely with Webmin
Bog-standard iptables firewall
This may be basic, but it works. Try a door and unless it's whitelisted, it won't budge.
The assumption here is that you either do not have a firewall, else that it needs re-addressing. For the former, we will install the package and, for both, we'll tune the ruleset.
Assume root privileges and list your current rules:
sudo -i
/sbin/iptables -L
If it looks like this, you have no rules:
Or if instead you receive an error like this, then the package isn't...