0

I am using ubuntu 12.04(LTS) 64 bit. i have edited "group" file in directory /etc. i added my user name which is "erfan" in front of "vboxusers" as following :

in below you can see some lines of my group file

root:x:0:
daemon:x:1:
bin:x:2:
.
.
.
erfan:x:1000:
sambashare:x:124:
debian-xfs:x:125:
vboxusers:x:126:erfan
vboxsf:x:127:
guest-59wkHG:x:128:

after this change i can not use "sudo" command and i receive following message:

"erfan is not in the sudoers file. This incident will be reported."

i can not install any package and manage my operating system.

i think if i can find a way to delet my user name ("erfan") in front of "vboxusers", then this problem will resolve.

could you give me an idea to delet it and edit "group" file? or any way to resolve this problem?

3
  • 1
    You've answered your own question... to be able to do admin tasks that require "sudo" capability you need to be in the sudoers file... this has nothing to do with the groups file...
    – Kinnectus
    Aug 11 '14 at 11:43
  • You shouldn't manually edit this file. Restore it from a backup.
    – slhck
    Aug 11 '14 at 11:43
  • 1
    If you want to undo the change, just boot from install or rescue media, mount your root file system, and undo the change from there. Or easier, restore it from a known good backup.
    – user
    Aug 11 '14 at 11:44
1

Default sudo configuration (/etc/sudoers) says - members of groups admin and sudo can execute sudo command (and there is no admin group in Ubuntu, so sudo group only).

Apparently after your edit, your user is no longer a member of this group.

To fix it you can:

  • boot from Live CD
  • open terminal
  • sudo su - will switch you to root
  • mount your root partition (ie mount /dev/sda1 /mnt - where sda1 is your root partition)
  • edit group file (joe /mnt/etc/group) and add your user back to sudo group
  • unmount root partition (umount /mnt)
  • reboot
  • give someone a hug :)

Your Answer

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

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