While the previous answer picked up on my comments about blocking root with usermod -L
or passwd -l
and effectively setting the password field to !, they do no explain your predicament.
I have been thinking why the book says that deleting with passwd -d
prevents access. When you set the password to a blank, with -d, you will prevent all non root users to access the root account remotely, because non-root users cannot move to another accounts that have no password. As ssh nowadays also blocks root by default, the root account will be effectively blocked from the perspective of remote and non-root users. (e.g. the only way as working as root will then be sudo)
Nevertheless, the book should mention any user in the local console can login as root without password. Whist nowadays most of the consoles are out of reach of normal users in the console of virtual environments, it is always sensible to have a way of controlling root password.
A more sensible policy as such is blocking root with usermod -L
or passwd -L
, but not before establishing a sensible user policy, and testing it.
An alternative is to establish a very secure root password that is changed regularly that no one knows (generating it randomly with makepasswd
and keep it in an envelope for instance) for emergency cases (single-boot for instance, or when someone mistakenly messes up the sudo configuration. Then indeed the root password can come handy. This way, privileged work via sudo will be enforced. Otherwise, with root locked, the alternative is booting via a CD or pen, either virtual or real.