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!

  • TeaWithDani@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    edit-2
    3 days ago

    Exactly, you shouldnt add your user to Docker and you should run your Docker containers as your user or another limited user rather than the default root.

    Be very selective with whether you expose your docker socket to any container. I just give Beszel Read Only. Gives me container perfs and flags updates.

    For the update script, you can just make it a cron job. Id add that to the guide. A daily update and weekly backup cron job is my setup.

    • nixos_fan@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 day ago

      Use podman instead, it doesn’t need root. And putting the docker socket in ro mode doesn’t help at all, because ro is for files, while this here is a connection.

      • TeaWithDani@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        1 day ago

        Yeah, I’m evaluating moving to it, or just running everything baremetal or in jails from FreeBSD. Slowly moving away from Linux in general.