Super User is a question and answer site for computer enthusiasts and power users. 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've got a computer running Ubuntu 9.10 Server, and i added myself to a new group using the following command:

sudo usermod -G my_group me

i learned that command removes me from all the groups i was in (like the sudo group), and adds me to only my_group.

the problem:

  • i was the only one in the sudo group, there is now no one
  • i never enabled/created a root
  • i don't remember setting one up when i installed the OS
  • when i type su and try the same password as my account (the account i set up when i installed the OS), it is not accepted

did i screw up my computer? do i need to spend an hour re-doing everything? or is there a way to recover?

share|improve this question

There is a root account already installed, since you don't know the password you can access is from single user mode then change your accounts groups.

to boot into single user mode:

  • At the GRUB menu, use the arrows to select the boot entry you want to modify.
  • press e to edit the entry
  • use the arrows to go to kernel line
  • press e to edit this entry
  • at the end of the line add the word single
  • press ESC to go back to the parent menu
  • press b to boot this kernel

You will be presented with a shell prompt and you'll be logged in as root without providing a password, you can test this by running whoami. You may also need to mount certain partitions depending on your setup and where the binaries you'll need are located.

share|improve this answer
how do i get to the grub menu? i think i'm supposed to press the Esc key after the BIOS screen goes away, but when i do this i get strange behavior at the login screen, and no menu. thanks. – aaron Jan 14 '10 at 4:02
You're supposed to press Esc when you see "Grub loading... ". – John T Jan 14 '10 at 4:21

try passwd root it might work if you never set up root

share|improve this answer
just gave it a try, no luck – aaron Jan 14 '10 at 3:43
up vote 0 down vote accepted

here's what i got to work:

  • reboot the computer by holding ctrl+alt+del at the initial log in screen after boot (physically at the machine, not ssh)
  • hold the esc key while booting
  • the computer entered some weird state where it has both a root shell and a login prompt. i was able to enter a command in between the pauses while the login prompt was checking my username/password
  • i added my username to the sudo line in /etc/group

i don't know what i was in, but i don't think it was the grub bootloader. any information on why it just gave me a root shell when i held esc during boot instead of grub would be appreciated, thanks.

share|improve this answer

You must log in to answer this question.

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