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 accidentally commented the line Members of the admin group may gain root privileges:

%admin ALL=(ALL) ALL

in /etc/sudoers file, now i am unable to sudo into my system using the only available existing user.

The default solution would be to drop into root account by going into safe mode but problem is root account seems to have password set which I don't remember (I don't even remember when I set it), so I am unable to enter into root account in safe mode to fix this file.

I can do anything non-related to sudo like browsing internet, posting this post but not basic stuffs like proper shutting down of computer using halt command, etc.

So, can anyone provide solution to it? Can live CD help here. I don't want to mess it again. It just one line mistake that's it. My system is Ubuntu 12.04 if there is specific fix in this version.

share|improve this question

Use your live cd to recover (edit the file), or boot into single user mode. (

Then you can edit the file and fix the issue.

Either option will work, single user mode is faster. Make sure you mount your root directory read/write before editing the file.

share|improve this answer
since the system asks admin password while getting into safe mode(which i already mentioned) i have only one option available. thanks will give it a shot – user103937 Nov 3 '12 at 3:42
single user mode SHOULD NOT ask for a password. The kernel dumps you to a terminal before you ever get near login. It doesn't log anyone in or anything. It's not the same as safe mode. In fact you use single user mode to reset the root password when you have messed it up. – coteyr Nov 3 '12 at 4:32

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.