by devit · 11y ago · 0 comments
But anyway, just disable passwords and login with SSH public key authentication.
SSH keys are good, but there are always should be rescue password which can be entered via IPMI or by physically attaching to the server. Also, `sudo` password (which is also handled by /etc/shadow) is a good measure on production servers and should be set somehow. shadowd resolves it.
If it's an emergency you can reboot into a single user/recovery/rescue state and reset it. No need to increase the attack surface just for that.
>Also, `sudo` password (which is also handled by /etc/shadow) is a good measure on production servers and should be set somehow.
I agree about a sudo password being a good idea, but if we're talking about the "right" way I'd say a authentication directory backend of some sort would be better suited for that.
Regarding authentication backend I've already tried to address that vision. Unable to become root when auth backend offline/unreachable/misconfigured is significantly worse than having local shadow which is always works.
Agreed, if you have something like dish installed, something like
dish "echo root:password | chpasswd"
should do the trick to everything dish knows about.
This is a simplification, but the general idea isn't too far off. If you don't know why its a simplification, then doing it this exact way is probably a bad idea.