Skip to content

Instantly share code, notes, and snippets.

@wuriyanto48
Created February 7, 2024 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuriyanto48/57b1671d0a222f17422b18931ca8dc7e to your computer and use it in GitHub Desktop.
Save wuriyanto48/57b1671d0a222f17422b18931ca8dc7e to your computer and use it in GitHub Desktop.
sudo: no valid sudoers sources found, quitting

You can bind the /etc volume into docker like that:

docker run -it --rm -v /etc:/etc_host ubuntu bash

You gained root access. Then you can change the permissions of /etc_host/sudoers to 777:

chmod 777 /etc_host/sudoers

Edit, fix the file and save it with any editor:

vim /etc_host/sudoers

Change the permissions of /etc_host/sudoers to default 440:

chmod 440 /etc_host/sudoers

That's all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment