a while ago I gave root a password so I could log in as root and get some stuff done. Now I want to disable root login to tighten security, since I'm going to be exposing my serve to the internet. I've seen several ways of doing this (sudo passwd -l root
, fiddling with /etc/shadow
, and so on), but nowhere that says what the best/most sensible way of doing it is. I've done sudo passwd -l root
but I've seen advice that says this can affect init scripts, and that it's not as secure as it looks since it still asks for a password if you try to log in, rather than flat out denying access. So what would be the way to achieve that?
EDIT: to clarify, this is for local login as root; I've already disabled remote login via SSH. Though trying to log in as root over SSH still prompts for root's password (which always fails). Is that bad?
rm
command or such. Something I learned the hard way. Yes, one simply can NOT log in as root, but disabling it does makes sense from sys admin point of view.