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.


Kalle Tolonen
March 20, 2023


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.


Comments

No published comments yet.

Add a comment

Your comment may be published.