Lessons learned from yesterday:
- Never edit the sudo users file manually
- Never lose the root password
We have a small development box that runs a copy of Ubuntu server on it, used basically to host a database and nothing else. It isn’t mission critical, just sits by my desk. I set it up about a year and a half ago and it’s been running fine ever since. Except for the fact that I didn’t save anywhere what the root password was, everything was good.
I was trying to add another sudo user to it when I screwed it up. Having typo’d in the sudo users file, I found I’d locked myself out of anything admin related because sudo now threw up a syntax error. Not good. What’s also not good is the fact that I clearly picked something super safe and secure for the root password as nobody knows what it is.
It wasn’t a mission critical machine (I’d never touch sudo management on a machine I know I didn’t setup myself and or has critical data on it), but it looks like unless I have a epiphany and remember the root password I’ll be reinstalling the OS come Monday. It was about time we updated the database version in it anyway, but still.
Lessons learned. Don’t mess with sudo.