No valid sudoers source

I tried the running sudo without password thing.
well… now I can’t access any sudo action anymore.

sudo nano /etc/sudoers.d/010_pi-nopasswd```


it says:

´´>>> /etc/sudoers.d/010_pi-nopasswd: syntax error near line 1 <<<
sudo: parse error in /etc/sudoers.d/010_pi-nopasswd near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin``

What shall I do now???

Hey looping, I bumped this to a new thread so we can explore what’s happened.

Have you restarted the device after making the change?

Am I understanding correctly that no sudo commands are working after this change?

If there’s nothing of value on your install, as in nothing you can’t reinstall easily like Skills, then I’d reflash the image and start with a fresh install.

Otherwise you could plug the Micro SD card into your primary machine and modify the file. You’d need to double check where it’s mounted, this can differ between distributions. On a standard Ubuntu install it would be /media/user/rootfs. In this case…

To turn on password protection you can run:

echo "pi ALL=(ALL) ALL" | sudo tee /media/user/rootfs/etc/sudoers.d/010_pi-nopasswd

To turn off the password requirement run:

echo "pi ALL=(ALL) NOPASSWD: ALL" | sudo tee /media/user/rootfs/etc/sudoers.d/010_pi-nopasswd

Just make sure to change the “user” to your username.

Hey @gez-mycroft,

thanks for answering. Yeah sure I did a restart, didn’t help.

Yes, no sudo commands work.

I really don’t want to reflash the image…

I plugged the SD card into my primary machine now. It’s Windows10 though, so Linux commands do not help me. And even after a few hours, I can’t make out the location of the file…

This seems to be on the card…

and it seems to have only 252 MB?!

Alright, I got it!
I downloaded this from Paragon Software to be able to see everything on the card. And then I put in pi ALL=(ALL) NOPASSWD: ALL because before, I had made an ALL where to much haha