I screwed up the "octoprint-shutdown" file on my linux mint install, don't have sudo permissions anymore!

What is the problem?

I have a desktop running as a octoprint server, with linux mint 19.3 as its main operating system (4790K, 16Gb ram). I was having issues getting the "power" buttons in octoprint to work with linux mint (restart octoprint, reboot system), so I followed the info provided in the link below to get the buttons working. On my system, the file I changed was located in the folder "etc/sudoers.d" and is called "octoprint-shutdown". I kept trying random things that came to mind as I had no idea that if this file were to be viewed by the system as corrupted, then I would no longer have sudo permissions on this machine. I eventually did just that, and now get the error message linked below when I try to do anything on the machine in the terminal that requires sudo privileges. Regretfully, that includes trying to revert the "octoprint-shutdown" back to its original state. Does anyone know what I can do to fix my own stupidity?

Screenshot from 2020-02-13 20-54-44

What did you already try to solve it?

I created a Mint "Live USB" and booted into it (in the hopes of being able to change the file that way), but I didn't have any luck changing the file as it still says I don't have permission (how is that possible that the Mint flash drive knows or even cares that the Mint desktop is broken?).

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)

Octoprint version 1.3.12
Printer Lulzbot Taz 6
Browser Chrome and Firefox
Operating system Linux Mint 19.3

Thank you for your time, Ben

As I would say to my students, "...and what did you learnnnnn?"

God-only knows what goes on under-the-hood in Linux Mint with respect to sudo. You do need to make sure the pi (if that's your user for OctoPrint) is a member of the sudoers group, btw. Here's the closest thing I saw on their forum for managing this.

1 Like