I had the unfortunate experience to lock myself out from using
sudo on my NAS server.
All I wanted to do was give my user permission to run
smartctl, which usually requires root privileges. This can be achieved by editing the
However I did not use
visudo for this task. After removing the pound sign from the
#include statement – which, let’s be honest, looks like a comment that needs to be uncommented – I saved the file and closed it.
At this moment
visudo would have raised an error, if I had used it, and prevented me from saving the invalid
Long story short I was locked out from using the
sudo command. After booting into a Linux live/rescue image from USB I could fix the syntax error in
The moral of the whole story, better use
visudo when editing