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!

  • TrollAccount69@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    12 hours ago

    Yeah the Unix permissions model is insecure, acls have been around forever to deal with that.

    No one is suggesting to just force people to use sudo as a security measure. What I said was that using a nonstandard admin user account with other accounts disallowed from ssh access will prevent lots of intrusions because people are generally just running credential spam attacks and your weird admin account isn’t in them.

    Seriously look at your logs, it’s all generic well known accounts on port 22. You could prevent doorknob jigglers from getting in just by switching to a high port, disallowing all but one weird admin user and doing key as opposed to password. Fail2ban isn’t even really needed at that point and neither is port knocking.

    A user may be able to do a lot of damage (less with layered security or defense in depth) but the real benefit of sudo is that aside from being unlucky enough to be using musl ssh, asterisk root lets you be incredibly obscure and that does a lot to keep the rabble out.

    A while back I remembered the “would that end racism? Would that end sexism?” moment and I think a lot of your comment strays close to that territory. Ddos attacks are generally not the purview of how system administration is conducted, they are handled by cdns and infrastructure. Physical security is not the top priority of most server administrators (not because it isn’t important but because a vps in a container on a hypervisor running on a server in a rack in a datacenter with locks and cameras all around is in a much different situation than your laptop while you use the Starbucks bathroom, to be 100% clear).

    • MangoCat@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      4 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.