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!

you are viewing a single comment's thread
view the rest of the comments
[–] 14 points 2 days ago* (last edited 14 hours ago) (8 children)

Not today, satan.

Passwordless root allows you to require another factor of authentication on the off chance you didn’t set up key only ssh login like the top of the guide says. That second factor is the administrator account name. Now you can make this as generic as you want but assuming your non root admin account isn’t named “administrator” or “admin” then you just increased the security of your system.

Suggesting that because privilege escalation exists there is no difference between a user and root is absurd on the face of it. Privesc requires vulnerable versions of vulnerable packages with the specific circumstances present that allow pre and post exploitation actions. In case you were operating under the assumption that most privesc goes from local administrator to root, usually you’re going from some relatively unprivileged user account that handles a service up to root and that’s harder than just invoking sudo.

You would still want to roll over your credentials and restore from backups but “safe cracking tools exist so just leave the cash register deposits in plain view on a shelf behind the desk” isn’t a strong argument for password root.

E: @talkingpumpkin@lemmy.world correctly pointed out that a nonstandard admin account name isn’t a second factor. It’s more like an additional secret.

  • source
  • parent
  • hideshow 8 child comments
  • [–] 3 points 1 day ago (1 child)

    A "secret" administrator account name is not a second authentication factor: it's just another "something you know", basically the same as using a slightly longer password.

    On top of that, account names are generally not treated with the same confidentiality passwords or private keys are treated with: while you can trust that software and collaborators will not leak a password or private key, you cannot make the same assumption about usernames.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 19 hours ago

    Yeah that was a bad choice of words on my part.

    Consider though that everything I handle with a public facing ip gets 69 million attempts to login as “root”, “admin”, “docker” and everything else under the sun but not even once has someone tried to login as my admin user. It’s acting as more than a slightly longer password.

  • source
  • parent
  • [–] 1 point 1 day ago (5 children)

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

  • source
  • parent
  • hideshow 5 child comments
  • [–] 1 point 19 hours ago (4 children)

    Sure, onions can go all the way bad. I’d rather put my special thing inside an onion than an apple.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 10 hours ago (3 children)

    Apples, Onions, Chocolate Mousse, I'd rather have any of them inside a bomb-proof safe.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 8 hours ago (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 7 hours ago (1 child)

    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...

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 7 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.

  • source
  • parent