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
    ·
    2 days ago

    It’s nice that your system has layers, but when the cutworms get on your onion they can still spoil the whole thing.

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

          I’m gonna go out on a limb here and liken the encrypted shell access that requires an additional secret just to have one’s password considered closer to the bombproof safe than to a food item.

          A metaphor is nice but actually completing it is what puts it above mere allusion.

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

            I’m gonna go out on a limb here and liken the encrypted shell access that requires an additional secret to two secrets written on a sticky note instead of one…

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

              Are you now making an argument against password ssh or against obscurity altogether?

              If it’s the former I’m on your side. Key ssh with passwords turned off defeated the recent asterisk mess if anyone was unfortunate enough to be relying on musl ssh.

              • MangoCat@lemmy.sdf.org
                link
                fedilink
                arrow-up
                1
                ·
                59 minutes ago

                Sorry, that last comment was rushed and just reacting to the philosophy of “let’s just throw another password around it.”

                My real/main point is about root (sudo) access vs “unprivileged” users. In my experience, sudo is like putting up a (thin) glass window on a house, it’s a great way to communicate to gentle-folk that they are not supposed to come in, the door is locked, but they can still look inside (read access), and if they don’t mind making a mess they can certainly smash the window to bypass the lock, or if the window is too strong for them to break they can more easily burn the whole house down. A sudo locked door might make it necessary to have unusual lock picking skills if you’re going to sneak in, rearrange the furniture, then leave without everyone knowing that things have been messed with on first glance, but it’s not going to stop a DDOS from succeeding. The typical “non-privileged” user with command line access can easily trash most systems into a non-functional state, shortly after exporting most data of any value.

                Then (different, but related rant): all of the “physical access to the device required” attack hardenings are of little help preventing these kind of attacks: https://www.infosecinstitute.com/resources/general-security/usb-killer-how-to-protect-your-devices/

                Systems need good physical security first, and then they need serious least-privilege protection against ALL users, not just those who can get root access. Access to a general purpose terminal, even without root privilege, is more privilege than any untrusted user should ever have.