Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

3 Answers

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
2  
You're supposed to press Esc when you see "Grub loading... ". –  John T Jan 14 '10 at 4:21
add comment

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
add comment
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
add comment

Your Answer

 
discard

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.