Reset forgotten/lost main user password in Linux Mint

Alexio
  13 years ago
  25

You can reset your password following the next steps:

  1. Reboot your computer / Turn your computer on.
  2. Hold down the Shift key at the start of the boot process to enable the GNU GRUB boot menu (if it does not show)
  3. Press ESC at the GNU GRUB prompt.
  4. Press e for edit.
  5. Use the Arrow keys to highlight the line that begins with kernel and press the e key.
  6. Go to the very end of the line and add rw init=/bin/bash
  7. Press Enter and then press b to boot your system.
  8. Your system will boot up to a passwordless root shell.
  9. Type in passwd yourusername
  10. Set your new password.
  11. Restart your system.
Comments
TonyUkuk 7 years ago

@wanthai , did you pressed F10 after editing and nothing more pressed after that? If yes, it should bring root bash and how did you exited from bash after password changed - Ctrl+Alt+Delete? And are you sure that you typed in password - because there were situations when, say, NumLock, didnt enabled and typed password actually didnt typed and after rebooting it still doesnt "recognize" password because nothing was typed as NumLock was disabled.


wanthai 7 years ago

It works unfortunately not in Mint 18.1

I did this:

linux /boot/vmlinuz-..............\[letters and numbers] ro quiet splash vt.handoff=7

changed to

linux /boot/vmlinuz-..............\[letters and numbers] rw init=/bin/bash

but it still do not find my password.

Have anyone in here tried something like ;-)


Hammer459 7 years ago

The page @Reteip points to lists excactly the same solution plus a sh-tload of ads...


Alexio 7 years ago

Because Linux Mint is based on Ubuntu, I would recommend the information on the official Wiki at https://help.ubuntu.com/community/LostPassword instead.


Reteip 7 years ago

Hi folks
This site https://mintguide.org/system/248-reset-the-password-for-root-or-any-user-in-linux-mint.html has an easy to follow good up-to-date how to for this topic.
Yes, holding down Shift didn't always work for me either. I'm not sure if it was just trying again, and again with holding down Shift that eventually worked or the fact that I also used, after the BIOS screen disappears, Esc while holding down Shift to access the grub menu.
All the best!


abidan 9 years ago

Doesn't work as shown! The shift key doesn't seem to do anything as it boot straight into linux mint. At the bottom of the boot menu it shows an, "e", but "kernel" is not in the text. This needs to be totally redone!


MagicMint 9 years ago

You could do this from the “Linux Mint … – recovery mode” item of the grub menu as well.


jcxz100 9 years ago

I just did this on Mint 17.1 Cinnamon Rebecca.

It did *not* work the first 4 times I tried:
1: I set password to 8 alphanumerical characters (reapplying what ought to be the password to start with!) - Didn't work.
2: Tried same again (maybe computer had changed its mind?) - Didn't work.
3: Set new password of 4 lower case letters, no numbers - Didn't work.
4: Removed the password with "passwd -d _username_" - Didn't work.
5: Set new password to a single letter "x" - Worked!

There was no error message on the command line for either of the first 4 attempts; the password simply didn't work after I rebooted.

Strangely enough I did the same thing for a 17.1 XFCE recently, and that worked in second try (the first attempt was a very long password with strange characters and spaces; that had to fail).
(btw: Do I feel stupid for forgetting/mis-setting 2 passwords within a month? Sure do :) )


luisbraganca 9 years ago

Thanks to @eiger3970 it works, the tutorial should be updated or added a new line for "On mint 12 or older" with eiger's tutorial.
However, thanks to home folder encryption, login works but it's shown a black screen with an error message forcing you to log out:
"Could not update ICEauthority file /home//.ICEauthority" and the only option given is to log out. :) My personal data remains secure!


luisbraganca 9 years ago

This tutorial is really useful, I'll try it with mint 17.1 cinnamon on virtualbox (since I don't want to brake my laptop's os) and I'll comment here the results.
However, I really hope this doesn't work because I just realized that if someone steals my laptop it's really easy to access my personal data.


revmalc 10 years ago

Does this work in Mint 15?

Having made the changes to the file, how do I save it?


w5gcx 10 years ago

GNU GRUB file does not have line with kernel


norm37 10 years ago

My password was not forgotten, but another had been introduced by Mint. This procedure should cure the problem.


jahid_0903014 10 years ago

great!


carlos-teran 11 years ago

It's really a life saver. It's a little bit dated, but thanks to the helpful comments from eiger3970 and vonoctra, it still has relevance. Thank you for sharing and saving the day.


eiger3970 11 years ago

I tried this on my Linux Mint 12, however it it doesn't work.
Boots into a black screen and have to manually reboot and then shows regular welcome screen.

I tried:
In Linux Mint 12, the line to edit begins with "linux" and not "kernel"

Follow steps 1 through 4 above.
In step 5, navigate to the end of this line:

linux /boot/vmlinuz-3.0.0-12-generic root=UUID=[letters and numbers]\[letters and numbers] ro quiet splash vt.handoff=7

replace

ro quiet splash vt.handoff=7

with

rw init=/bin/bash

so it looks like this:

linux /boot/vmlinuz-3.0.0-12-generic root=UUID=[letters and numbers]\[letters and numbers] rw init=/bin/bash

Press Ctrl-x or F10 to boot with these options
Follow steps 8 through 11 in Alexio's tutorial as normal


iamclam 11 years ago

I want to try this on my Linux Mint 14 but for some reason it wont go to the GRUB menu when I boot holding shift. I hold shift, turn it on, keep holding shift, and it just boots right up to the desktop.


josefg 11 years ago

Excellent! Worked on Linux Mint 13.


arafs 11 years ago

how about linux mint 14? does it work?


kentmint 12 years ago

I think you should update the article according to bugmenot's comment. As of Linux Mint 14 RC (Nadia), bugmenot's comment is correct.
Thank you, Alexio and bugmenot.


Marcy 12 years ago

What about Linux 9? Am a TOTAL Linux (but not computer) newb.
Installed Linux (Isadora, it says) on HP Omnibook 6000.
Made it as simple as possible: I know my user name, I know my password.
I enter them in their boxes as they appear/are requested
(first one, then the other, but both never appear on the same screen. Also tried UC and LC letters, or first letter UC)
Box(es) return(s) for me to fill again -and again - and again - and again..... (ad nauseum) :x
NOTHING else happens, not even an error msg. :?: :?: :?:
Have rebooted -several times.
Have reinstalled and rebooted.
Same result. :evil:

Attempted the fix but got same result as djbyardie.

Ready to go back to Ubuntu, no matter how slow it was (and will be again) because at least it WORKED and made sense!
Would be a shame to quit now, but this...is...bloody...annoying :!: :!: :!:
The only good news is that this is a new install and I have nothing to lose, except time and my temper.
Help!


Gutknecht 12 years ago

Did not work on Linux Mint 13 even with @bugmenot clarification. Hit Ctrl=X or F10 screen went blank and nothing...... I see a reinstall in my future. But it shows me how much more secure Linux is....


Alexio 12 years ago

@stefi - You are welcome!


stefi 12 years ago

Thank you so much! Months ago i wanted to change my password, meanwhile anything happend and i went back from my netbook.... and was only able to log into my sons account whithout any permissions.

THANKS for bringing the files into my life again!!


djbyardie 12 years ago

Could not get it to work.After Step 7 did its thing for a while then came up with the following: bash:cannot set terminal process group(-1)Inappropriate ioctl for device.
bash:no job control in this shell
Any further help would be appreciated as i am new to Linux


kencameron 12 years ago

I made it up to step 9 (using bugmenot's variation) with everything looking ok, but then couldn't proceed - didn't know and couldn't work out how to set a new password or to restart my system. I am an absolute beginner with linux. Any further help would be much appreciated. My situation is that I can log on without a password but then am asked for a keyring password, which I put in successfully, but when I try to install apps putting in what I think is the correct password (the keyring password is the only one I have ever used on the system) I get "sorry...".


Alexio 12 years ago

@bugmenot & @compuman2004 - You are welcome!


mcfaiaz55 12 years ago

It does not work.


Tazmanian-Hat 12 years ago

Thanks for this. but I can't get past step 3. It won't respond to anything at the GNU GRUB screen.


cutabovehost 13 years ago

There is no line that begins with kernel as described in step 5