I don't exactly know what I did wrong, but now every command that needs sudo
returns:
sudo: /etc/sudoers is owned by uid 1000, should be 0sudo: no valid sudoers sources found, quittingsudo: unable to initialize policy plugin
I found a bunch of answers for fixing this in these situations:
- If I was running Linux and could boot with a live USB
- If I was running Mac OSx.
But I'm running WSL2 in Windows 10, so these answers didn't helped me.
Have I rendered my WSL useless? Is there a way to fix this windows-side?
Things I've tried in WSL terminal (Ubuntu 20):
pkexec chown root:root /etc/sudoers /etc/sudoers.d -Rpkexec visudo
Both gives me Error getting authority: Error initializing authority: Could not connect: No such file or directory
response.
I've also tried su - root
, but I put my password and it gives me Authentication failure
.
Let's suppose this has no answer and I need to reset my Ubuntu WLS install. Is there a way to export everything that I did, installed and all, or will I have to start ALL over?
Thanks a lot.