Recover Forgotten Ubuntu Password without reinstalling

If you forgot you password for your ubuntu system you can recover using the following steps

Turn your computer on.

Press ESC at the grub prompt.

Press e for edit.

Highlight the line that begins kernel ………, press e

Go to the very end of the line, add rw init=/bin/bash

press enter, then press b to boot your system.

Your system will boot up to a passwordless root shell.

Type in passwd username

Set your password.

Type in reboot

If this doesnt work you can alternatively try this:

Turn on your computer, and as soon as you the Press Esc to enter grub message, press the escape key.

Select the option that says (recovery mode).

Your PC will boot into a shell. Once you get a command prompt, type "passwd username" where the username is your username.

Enter a new password when prompted, and again when prompted again

Type reboot to reboot your system

Another way is to boot into the system via a live cd open up Applications->Accessories->Terminal
then mount your ubuntu drive if its on /dev/sda1 do this:
mount /dev/sda1/ /media/sda1
Then we chroot into the system:
chroot /media/sda1
passwd user
Now change the password, and reboot your box!

Comments (23)

Loading... Logging you in...
  • Logged in as
um, how is this not a security vulnerability?
1 reply · active 867 weeks ago
IF you can reboot the system, then no system is safe. Windows, Mac or Linux.
This is not a security vulnerability, no system is safe howsoever strong the security is, if the hacker has physical access to machine.
you can even change the root password by booting into single user mode through LIVE CD, this is not a security flaw, its a back-door recovery system.
2 replies · active 830 weeks ago
This may be security vulnerability, in cases when user can access keyboard but not machine itself. This usually hapens in factory floor or 'web kiosk' style installions where computer and display are locked in metal box that has a window for user to see display. (Admit it, windows is just so much more secure than linux :-)
You can achieve such security with :
- lock up the boot sequence within bios (HDD only)
- lock up the bios (passwd)
- lock grub (passwd)
And linux kiosk are way more locked and secure than windows alternatives.
so whats the point of having a password?
Is there a windows equivalent for that?
For the best system security you should use full disk encryption via the Ubuntu Alternate Install CD (<A HREF="http://news.softpedia.com/news/Encrypted-Ubuntu-7...REL="nofollow"><a href="http://news.softpedia.com/news/Encrypted-Ubuntu-7-10-68383.shtml). ">http://news.softpedia.com/news/Encrypted-Ubuntu-7-10-68383.shtml).
Windows is no more secure. Several bootable cd's can be used for cracking Windows logon passwords. Or, if you're feeling rushed, there's a different cd that performs a registry hack (with no pwd needed), and deletes the admin password automatically.

Encryption, as was mentioned above, is the only real safeguard against physical access.
3 replies · active 842 weeks ago
That is really nice to know. I want a live CD that can be used to "cracking Windows logon passwords".Whichdo you suggest? I want to see it to believe.
Ophcrack is one I have on me right now. Only fault is it doesn't work against very strong passwords (special characters, etc). There is another that I have that is more efficient (deletes the password, rather than cracks it) , but I can't find it right now. If you're interested, I'll see if I can find it.

http://it.slashdot.org/article.pl?sid=07/09/10/14...

If you have a linux live cd, you can mount the windows partitions from there as well.
ntpasswd is the one you want. the sysresccd can also do it.
Austrumi has an XP admin pwd reset option
...You can protect your bios by a password and disable that option in grub too.
3 replies · active 835 weeks ago
if i have physical access i can clear your bios
not if i mod the motherboard surfed
Actually, bios passwords are easy to crack.
You can break any 2000/XP/Vista password with the NT Offline Password & Registry Editor boot disk. Google it. You probably won't be able to obtain a really strong password but you can delete it instead and then log in as administrator passwordless and do whatever you like. Takes about 2 minutes.
Cracking a password and bypassing it completely are very separate things.
Windows equivalent:

tap F8 to enter safemode.
UBUNTU SUCKS
You can change the windows password in 10 minutes (on a password protected system):
1. Use a Windows XP SP2, (SP1 may work, SP3 wont)... boot to it, duh
2. Run setup like your going to install it, but choose repair instead (not by pressing r at the first screen, but later on), this will "repair" the installation, and continue setup like normal.
3. On the second phase of setup, when it says "Detecting hardware" Hold Shift and hit F10. A command box will come up. type userpasswords2 on the command line, press enter.
4. Change the passwords as needed, or even better, make your own administrator, not even changing their password. You can cancel setup, and reboot the computer, no changes except the passwords (and your new admin) have been made.

No system is fully usable or portable or reliable, Vista tries harder by encrypting the filesystem, but makes file recovery in corporate environments and legal eDiscovery impossible. The trick is to separate your data from your OS. There are some great home and corporate NAS/SAN systems now that can encrypt data.
it doesnt WORK !!!!!!!! i type pwasstord <username> and it told me the is not such command :? ???????????????? how to recover my password

????????????????????

Post a new comment

Comments by

Clicky Web Analytics