Ubuntu Guide For Windows Users: Reset Your Password When You Have Forgotten It
For Windows users, several solutions exist if you have forgotten your password such as creating a password reset disk.
But how about if you are on an unfamiliar system such as Ubuntu (or any Linux distribution) and you forgot your password. Do you know what steps to take to reset your password so you can log back in to your computer?
Unlike Windows, this process is a lot easier.
To get started, just boot your computer and when you see "Loading Grub" press the ESC (Escape) key. If you missed it, just reboot and try again.
Once you see the Grub prompt, press 'e' to enter Edit mode (as shown by the arow in below screen shot).

Next, highlight the line that begins with kernel and press 'e'.

Now, what you see may seem a little odd, but go the very end of the line, hit the space bar once, then type the following command after the word 'splash':
rw init=/bin/bash

and press enter, then b to reboot.
After Ubuntu has restarted, instead of loading the GUI, you will see a passwordless root shell. At the prompt, type the following command and replace 'username' with the name of the account you want to change the password.
passwd username

Type in a new password and retype to verify, once you see the confirmation that your password was updated successfully, reboot.
When GNOME loads enter your new password and you should be good as new again.
Filed under Ubuntu And Linux Tips by
Leave a Comment

Comments on Ubuntu Guide For Windows Users: Reset Your Password When You Have Forgotten It
I am not sure why this is considered easier than Windows, but that is a typical comment to make.
Anyway, what if you have ab encrypted rootfs or use SELinux?
@Silver
With Windows, if you don't have another account (with rights to change user account passwords)you either need to create a password reset disk or use a third party utility just to change your password (when you have forgotten it).
Compare that to Linux, the above method is much easier.
As for ab encrypted rootfs or SELinux, I'll need to do some digging if the method can be used.
There's an even easier way: just select the recovery mode option, select "root" (Drop to root shell prompt) and change your password that way. No need to alter any lines or anything of that sort.
How can this be secured against? If I won't forget my password and would rather reinstall than leave root access open this easily?
Isn't that what the "recovery mode" option is for? I haven't used Ubuntu in a while, but on Gentoo that means a root prompt in single user mode. (i.e this)
And to answer Jimmy, there is no way to stop access to the root prompt on your computer (if you have physical access), but you CAN encrypt the hard disk. Then you have to enter a password to boot up at all. There are many howtos on this, but you only want it if you really care about security.
WOW!!!
You guys need some serious help. First of all, yes those will work.
If you don't want people to edit GRUB in this way, then password protect it. This guide goes over using encrypted passwords, but plain text passwords are also possible. The idea is to protect 1. booting into recovery mode, and 2. editing the configuration file.
http://www.debiantutorials.org/content/view/40/227/
I also added a comment in there to explain some things.
The will pretty securely cover GRUB. BUT, I know of a way around this. You can boot to a live CD and change the systems /etc/shadow file which contains system passwords. You can replace any users password with another hash. But once GRUB is locked down, going through that process would be pretty painstaking since you can no longer just wipe the root password and boot into recovery mode.
Anyway, how some of that has been cleared up for you.
No amount of security will help if the attacker has physical access to the machine. There are even ways around drive encryption, especially if the drive is still mounted when the machine is 'attacked'. Boot passwords and BIOS passwords are easily circumvented to even the slightest determination. All you need is a livecd and a screwdriver!
The above shouldn't ever be used unless you really know what you're doing and won't work for encrypted volumes (in most cases you WILL run in to trouble if you set init to a shell, such as the environment not being set up (thus making vim and other editors useless)). Use the recovery mode to properly boot in to single user mode, as it will run through essential init scripts.
On most Linux installs, setting init=/bin/sh will boot with / in read only mode too since remounting it is handled by a init script.
It's called recovery mode for a reason! Use it!
It did not work. It is showing that command not found.
To secure against this:
1. Disable boot from anything except hard disk in BIOS and password-protect
2. Make grub password ( http://ubuntuforums.org/showthread.php?t=7353 )
Sorted.
hey iam asking for help for a friend, i told him there is a free disk that i can download for him. He has a vista P.C. and has forgotten or someone was playing aroung with his P.C. and changed his password, he needs passwoed to open enternet, so could you please send me an email about disk, i would appercite very much….
thanking you in addvance Debbie
@Debbie
I believe your looking for this post –> Reset your Windows Password When You Have Forgotten It.
Hello all:
I'm stuck. I forgot my password.
I "tried" to follow the above procedure, yet, I am unable to "see" grub.
When linux starts to boot, I press ESC and it still loads.
Would it be because I'm using Linux Mint and the panel (starting panel when we turn on the computer) is not the same?
Signe: Eternal Newbee
Daniel.
@ Eternal Newbee
Daniel, you must shut the machine down.
When you reboot (restart) it, the machine goes through it's POST (Power On Self Test) and scrolls through a list of information including things such as the BIOS version, the hard drive and memory the machine sees. Then it will enter the GRUB loading stage. If it does not enter GRUB loading, you would never get to a welcome screen.
What you need to look for is in the UPPER, LEFT-HAND corner of your screen, after the POST completes. It will say simply "Loading GRUB 1.5" or something to that effect.
It is while this message is showing in the upper left-hand corner of your screen that you must press the Esc key.
It worked.
Thank you, THANK YOU, T H A N K Y O U
It took me a couple of tries and I got it OK.
Rolling again.
Tks so much.
If I can be of help. Please let me know
Daniel.
@Silver:
@Daniel:
I did get complete satisfaction.
Tks.
Daniel.
hi all,
i have a problem here.
i put a password for the bios of my laptop before a very long time and i didnt use it at all so i forgot it. everytime i format my laptop i just press f12 and it asks me to boot from cd and i do, but i cant enter to the bios setup. i installed the ubunto and i hope that there will be a solution for my problem.
so the password is only for the bios setup.
i tried by taking out the battery it didnt work. the motherboard has no jumpers ……
the laptop is fujitsu siemens s7020. bios is phoenix ver. 1.14
thanks.