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.
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.
what should I do if no matter how fast I press ESC it just won't go to grub prompt?
Im a VERY new user to the Linux OS Ubuntu. If you look down at the tool bar there's a place where it says the user that is logged ins name. If you right click it brings up options. I clicked on "Edit Personal Information" And in the right hand top corner there's a place where it says your username and underneath that it says something about a password. I set up a password and forgot it now I can't remember it. So the case is It won't let me download anything. Although I can download videos and add-ons, small things. Would this guide your offering me be helpful in my situation?
@mario
Laptop BIOS since the early 90's have been made to write all changes to CMOS, so even when the battery is removed the information is kept. This is to keep stolen laptops, if the BIOS is password protected, from being usable. You might want to try the manufacturer of your laptop, and more than likely, you will have to show proof of ownership and even then there is no guarantee that they will provide you the master key. Best of luck!
rw init=/bin/bash
that was perfect.
thank you.
but, what does it means?
is it something like "the initialization will be at directory /bin/bash (where I can execute comands as root) and I can read and write"?
Hi a friend installed Linux mint release 10 Julia on my desk top computer however is no longer with us, I don't have a password, have looked on a few sites talking about changing the kernel line in but I don't have a line starting with kernel help help
I think, with the info your giving here that the how to that is posted above on this same page would do it.
If you have more info you need, don't hesitate.
Daniel.
Yes don't have any passwords or username can I get round the password ?
Can you help?
Hello Steve,
Did you follow the above mentionned procedure? If no, give it a try, it works when you work it!
Daniel.
I don't have a line starting with kernal
Dunno what to say
My email addy is [email protected] I'll send you a picture to show you
i had been away from the whole ubuntu experience for now 2 years. don't remember my user anme or logini ..
and have just tried these instructions .. please i hope you can bear through my newbie lingo and not having everything written down from what occurred afterward
my kernel line , after splash ro ended with "single".
i entered in the rw = … as written above .. after about ten seconds .. an error came to bottom of screen, with a non syncing issue and dump something about ftrace .. what is this all about !? i really am concerned i may have done some permanent to my system / disk .. i restarted , and have had no luck getting any further
Please PLEASE i would appreciate some guidance here >. <
what if theres no kernel shows up omly 'crubchbang linux"
what if thers no kernel shows up only crunch bang linux
I desperately need help so please try to help me out!! My problem is when I get to my grub screen where I am supposed to replace "ro quiet splash" with rw init=/bin/bash, in between "ro" and "quiet splash" is my crashkernel sequence: crashkernel=384m-2G:64M,2G-:128M. Before this crashkernel sequence is ro andd after is quietsplash. How do i get to the passwordless prompt? Where do I write rw init=/bin/bash?? Thank you in advance!! If at all possible please email me- my email is [email protected]. Thnks.
after i applied the rw init=/bin/bash and boot i got this: splash no such a file or directory kernel panic no syncing attempted to kill ini. any thoughts? thanks
this answer was very helpful for me….when u'll press escape button u'll see an option that says restore system settings just click on that and don't worry ur imp. files won't' b deleted they'll b backed up