1

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.

1 Answer 1

1

Use your live cd to recover (edit the file), or boot into single user mode. (http://askubuntu.com/questions/132965/how-do-i-boot-into-single-user-mode-from-grub)

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.

2
  • 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 Nov 3, 2012 at 3:42
  • 1
    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, 2012 at 4:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .