From charlesreid1

Fixing sudo error on digital ocean droplet

I accidentally removed myself from the sudo group, and ended up unable to run any sudo commands because I was no longer in the sudoers file. Oops!

The fix is described here, but requires dropping into a command line by booting into grub: http://www.maketecheasier.com/fixing-sudo-error-in-ubuntu/

How to boot to a command line with a Digital Ocean droplet?

Turns out, you don't even need to reboot the machine! [1] You can go to your droplet's control panel, click "Access", then click "Reset Root Password" to have the password reset and sent by email.

Alternatively, you can add an SSH key and reset it that way.

Once you've done that, you can to to the droplet's control panel, click "Access" again, and get a command line at the droplet. There, you can login as root, and fix group/sudoer problems that way.