So, somehow one of the guys on my team messed up the sudoers file on a couple of VMs (all Ubuntu 18.04).

The files were truncated and the only line in them is: nagios ALL=(ALL) NOPASSWD= ALL

Which, fine, su to the nagios user and fix the sudoers file, except the nagios user has no password assigned, and there is no root password defined. So that won't work.

Any ideas how to fix this?


1 Answer 1


Can you (if reasonably practical) start the VMs using a (virtual) external storage device? A medium with a live system will allow you to mount the filesystem and edit the sudoers file as root without needing that file for permissions, since the live system grants the permissions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .