1

Okay, I've googled and checked every dang page I can find. They all tell me to add single or init=/bin/bash to the end of the kernel line. Well I don't have a line that starts with kernel when editing the grub.

How the heck do I reset the root password!?

Joseph
  • 657

1 Answers1

2

I'm assuming that you're utterly locked out of your box, otherwise you could just do:

$ sudo passwd root
[sudo] password for yourusername: type-your-pass-here
New password: type new root pass here

OK, so you're booting and you're at the grub menu. Do a quick down & up arrow to stop the automatic countdown clock. Next, just type init=/bin/bash or arrow down to repair mode (which is actually single-user mode). That is the kernel line. (You might have to tab to get down to the edit line... can't exactly recall since I'm not going to reboot just to double check).

This will bring the system up in single user mode. There you can type:

$ passwd root
New password: .....

When you've finished, exit the shell (^D or exit), and the boot process will complete.

A side note.... You really shouldn't have to set a root password on your machine. Just log in as the main user (the one you supplied when you installed ubuntu) and type sudo -i at your command prompt, and voila you become root.

unpythonic
  • 301
  • 2
  • 4
  • Only problem. I don't have either password. I don't remember mine or root. And I would go to the end of the line where it says ro (and replace with rw init=/bin/bash) then boot, and it just freezes. Any chance you can take a screenshot so I can see? – Joseph Jul 02 '11 at 00:41
  • @Joseph - No, can't really take a screen shot while it's booting :) I suggest reading http://www.ubuntugeek.com/how-to-recover-password-under-ubuntu.html (or if that doesn't work section 2.1.2 of http://linuxgazette.net/107/tomar.html ). After you add the rw init=/bin/bash, are you hitting Enter then pressing b to boot? – unpythonic Jul 02 '11 at 01:00
  • I'm changing the ro to rw, adding the init etc, then hitting control x to boot since that's all I can do :-/ – Joseph Jul 02 '11 at 01:08
  • @Joseph - Then I suggest you boot from your install cd/dvd and follow the directions in section 2.1.2 of that second article. – unpythonic Jul 02 '11 at 03:21