Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was in the /etc/sudoers and might done something wrong, beacuse after I couldn´t use the commandline again. Maybe i deleted sudo in /etc/sudoers. It said something was wrong i line 28. What can I do to restore this or do I have to install Ubuntu again??

share|improve this question
First off, you should only edit /etc/sudoers with visudo. – smooth-texan Nov 24 '12 at 15:36

You can try this:

  1. Reboot the machine and choose for grub's menu "Advanced options for Ubuntu" enter image description here
  2. Then "Ubuntu, with Linux (your kernel) (recovery mode)" enter image description here
  3. after that choose "Drop to root shel prompt" enter image description here
  4. Below you will have a prompt.
  5. Make sure you have write perms in the filesystem.Type:
    mount -o remount,rw /
  6. Got to the /etc folder.Type:
    cd /etc
  7. Make sure you have write perms in the sudoers file, or type chmod 640 sudoers, then type:
    Here you have a screenshot of the "sudoers" file. enter image description here

Maybe you have deleted the line "%sudo ALL=(ALL:ALL) ALL"
Edit the file and save the changes (ctrl+x and shift Y), change the perms of the file with to chmod 440 sudoers
Then exit and "resume normal boot"

I hope this will helpful.


share|improve this answer

It is critical that you use visudo and no other method for this, or else sudo may break. Please consider reading that post to make sure you avoid the problem. In short, sudo appears to have been programmed not to work at all if the permissions of a sudoers file is not 0440. The visudo command creates files with the right permissions. By using a different method, you could temporarily wind up without administrative access (because the default umask does not create files with 0440 permissions).

Select the recovery console during the GRUB boot sequence. You can then change the permissions of the offending file so that all is normal after the next reboot. Or, if it's just a typo, you can fix that, too.

share|improve this answer

Easiest solution is booting into recovery mode by pressing Shift before the Ubuntu logo appears and then edit /etc/sudoers using visudo in the rescue shell.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.