How to fix WSL sudoers-file

The error "Error getting authority: Error initializing authority: Could not connect: No such file or directory wsl" is a bit tricky one - but easy to fix.

How you got yourself into this mess

You propably tried to edit the sudoers-file with a regular text editor and thus "corrupted" it, and now you can't edit it anymore with sudo or visudo.

The solution is simple - just start WSL from Windows cmd with

wsl -u root

After that you can edit the sudoers file and get on with your business.

All articles


Comments

No published comments yet.


Add a Comment

Your comment is held for review before it appears publicly.

Your email is never published or shared.

Up to 2,000 characters.

Tick the box, then click Submit right away (Google expires the check after about two minutes).