I am to tired to test this now - but I guess as prerequisite you should then give the root user a password.  A long time ago I was "providing" root with a password in some Debian or Ubuntu system using 'passwd'.

sudo should not cope with an undefined root password, and visudo is just a wrapper around vi(m).


BTW just for testing you can create another - temporary - user and give him the sudo rights.


On 15.10.2024 22.19, Chris Green wrote:
I'd like to force a different password from my own password when I do
'sudo -i' to get root privilege.  However I'm a bit frightened about
what might happen if I set 'Defaults rootpw' in the sudoers file but
forget to actually create a root password. (This is on systems where,
previously, I've never had a root password).

Would this totally lock me out from becoming root? Would the only way
out be to boot into single user mode to mend things?

... or is visudo clever enough to spot this?


Reply via email to