I do not know the root password. I am only in group root. How do I add myself to other groups?

I am getting this error on trying to open root terminal:

Failed to run /usr/bin/x-terminal-emulator as user root.

The underlying authorization mechanism (sudo) does not allow you to run this program. Contact the system administrator.


As you do not have root access anymore, you cannot add yourself to the admin group. To do this, you need to boot in recovery mode to get root permissions.

  1. Restart your computer, and hold Shift (for GRUB2) for showing the boot menu
  2. Select "Ubuntu, with Linux 2.6.xx-xx-generic (recovery mode)"
  3. Pick "Root shell" from the recovery menu
  4. Add user abc to the admin group by running: usermod -a -G admin abc. The -a switch causes the group admin be added to current groups, instead of replacing the current groups.
  5. Reboot your system by running reboot
| improve this answer | |

Try opening a terminal and typing

 sudo bash

It will become a root terminal.

| improve this answer | |
  • abc@ubuntu:~$ sudo bash [sudo] password for abc: abc is not in the sudoers file. This incident will be reported. abc@ubuntu:~$ – Ankur Agarwal Jan 23 '11 at 6:59
  • @abc, how comes you're in the root group and not in the sudoers? Anyway, the only solution I see is: boot a live distro and manually edit /etc/groups to add your username after the last : of all the lines referring to groups you'd like to be in (for instance, adm:x:4:abc) – cbrandolino Jan 23 '11 at 7:05
  • I did a usermod without -a option. By live distro you mean a live CD ? – Ankur Agarwal Jan 23 '11 at 7:10
  • @abc: yep. or usb key. – cbrandolino Jan 23 '11 at 7:30
  • 4
    Your user should not be in the group root or sudo or whatever. It just needs to be in admin for sudo to work (unless you changed things in /etc/sudoers). – htorque Jan 23 '11 at 10:29

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.