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!

  • MangoCat@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    5 hours ago

    I agree: non-standard everything prevents standard attacks, the non-standard username effectively becomes yet another password - a password that’s likely not too hard to discover, but certainly more work for the attack script than “root”. Same goes for non-standard ports, port knocking protocols, etc. etc. Every one of those things is just one more layer of thing that is probably not too hard to find if you’re specifically attacking the system, but certainly slows down standard sweeps. 20 years ago, you could effectively “secure” an open FTP site just by moving it off of port 21 to something random and too costly to scan for - security through obscurity works, or maybe worked before we had AI bots to untangle all the obscure stuff.

    The core problem of basically all true cryptographically secure solutions is: key management. Focus your system administration design on use of strong keys, focus on strong key management, that’s true security. All the onion layers of obscurity are like hiding the key in the third flowerpot under the plastic plant pot inside the terracotta container inside a black plastic sleeve. Of course: real key management is hard, rotating the key hiding place between the third flowerpot and behind the wall hanging is something any sys admin can do.

    • TrollAccount69@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      8 minutes ago

      Yes and no. Of course an easy solution is easy and getting the easy stuff out of the way is the point of whatever shake a dead chicken ritual script you scp over and run on new deployments.

      Doing the hard stuff doesn’t make doing the easy stuff less worthwhile.

      I would also like to make clear that with nonstandard logins and ports, restricted ssh, key ssh and fail2ban you essentially don’t have attack surface. What are they gonna do, use a residential proxy network to spread attempts across 100k ips to figure out your port and login (if you’re just using some tla greybeard larp username) before they start running key attacks against you? No. They’re gonna go mess with something else where the service gives them something quick and easy to feed to antifox to get a win.

      Just because you ought to be able to put the keys to the castle in a perfectly cryptographically secure glass case on a pedestal lit up by a spotlight next to the gate with a sign next to it that says “these are the keys to everything” doesn’t mean you should.

      If security through obscurity didn’t work then we wouldn’t be seeing 69 million obscure bugs that are all old enough to drive being discovered by ai.