0

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?

2
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.