Enter recovery mode in headless ubuntu setup?

I know, there are lots of posts about this to enter recovery mode etc. But I have a raspberry running headless ubuntu server, and sadly I have no keyboard or monitor to connect to it.

So what I did is:

sudo chmod 777 /usr -R

and now I face:

sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

Is wiping my server the best option if I don't want to run out and buy a monitor and micro HDMI cable? I could get a keyboard from work, but if I can't see what's going on, I wonder if that would work.

So I have physical access, I just don't have the hardware to get into recovery mode as I understand it.


If you want to be able to enter BIOS/UEFI, Boot menu, Recovery mode, or other "special" modes on a headless server, you need to have some kind of virtual KVM (keyboard, video, mouse) connection.

Most "real" servers have an IPMI interface with a management LAN port that provides this access, however a Raspberry Pi does not have this feature, so here you need something even more special.

One option is to configure another Pi as a IP-KVM, like this. Jeff Geerling also has a video about this.

If you don't have a IP-KVM device, you need a physical keyboard, video and mouse to do anything outside a remote connection on a running OS (like SSH, VNC etc.).