When you spin up a fresh public Linux instance, automated scanners start knocking on your doors within milliseconds.
It doesn’t take much to get locked down properly, but missing a few basics can leave you exposed.
I’ve put together a straightforward guide covering the essential hardening steps from UFW and SSH key-only auth to secure Docker bindings and automated maintenance.
Original content by The Unknown Universe, written by a human and not AI generated!



I’ll have to find the post again (it was somewhere here on Lemmy) but UFW does not apply to docker containers.
Docker bypasses UFW because it uses iptables and UFW doesn’t support firewall zones.
Any docker/podman ports not bound to localhost will be publicly accessible even if you have a block rule on UFW.
There are some wacky script workarounds but the real solution is to install & use a proper firewall like firewalld (firewall-cmd command) and not the joke utilities of Canonical/Ubuntu (ufw, netplan, etc).
At which point you might as well chuck Ubuntu into the trash since you’d be replacing a bunch if its defaults anyway, and just stick with Debian or another quality stable distro like OpenSUSE.
I’ve been bitten by this before.
OP, this guide reeks of inexperience. It’s admirable that you’re trying to help, but there are footguns in just about every section of the post.