While working on ubuntu, I have edited sudoers file and allowed myself to run only mkdir, cd command. Now I am unable to execute, install any command. Even visudo is not working despite providing root password. How can I edit sudoers?

  • Use a Live-CD . – mviereck Apr 19 at 9:41
  • su - to switch to root (using the root password), correct the mistake. Also, allowing sudo cd is a bit useless as that would not do anything. – Kusalananda Apr 19 at 10:12
  • Ubuntu installations don't enable the root account by default - however, newer versions often allow at least local users to execute visudo via pkexec. See for example How to modify an invalid '/etc/sudoers' file? – steeldriver Apr 19 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.