2

In trying to reset my password on my personal Ubuntu 18.04 single-boot Dell laptop, I followed various steps in the 15 answers here. Unfortunately, none of them work for me. Around steps 7 and 8 my system behaves differently than the solutions and I never get to a prompt to enter passwd <usrname>.

I've tried a lot of permutations on the checklists I've found, here's the basic steps I'm taking:

  1. Turn on computer.
  2. Press and hold Esc key when Dell screen appears to enter GRUB (right Shift key didn't work for me; didn't try left Shift key).
  3. Select Advanced Ubuntu options.
  4. Select Ubuntu ... (recovery mode).
  5. Press "e" for edit.
  6. Navigate to the line that starts with "linux".
  7. I've seen and tried several slight variations in the edits recommended on this line:

.

  • Option 1: change ro to rw, then navigate to end of line and enter init=/bin/bash. Additional commands that already existed at the end of the line now separate rw and init=/bin/bash.
  • Option 2: change ro to rw and immediately after enter init=/bin/bash. Additional commands that already existed at the
    end of the line remain at the end of the line.
  • Option 3: navigate to end of line and enter init=/bin/bash. Do not change ro.

Here's where things go wrong. Regardless of what I enter above, I never get to a prompt to reset the password.

  1. Press F10 (or Ctrl-x) to boot the system.

From the instructions I've seen, this is where I should see a "passwordless root shell" or perhaps a Recovery Menu screen such as the one below that I copied from the accepted answer in the link. But I never see either of these.

enter image description here

Instead, depending on which edit I made in Step 7, one of two things happens:

  • If I changed ro to rw in Step 7, the boot process runs for several seconds and then stalls.
  • If I didn't change ro, the boot process runs until the GUI login screen.

Either way I never get to reset the password.


Edit:

My screenshots of steps 4 thru 7 following the checklist at https://wiki.ubuntu.com/RecoveryMode. As in my previous attempts, the boot process does not take me to the promised shell prompt to reset the password but instead completes on the Ubuntu log in GUI page.

Step 4 enter image description here

Step 5 enter image description here

Step 6 enter image description here Boot process scrolls up the window...

And ends with Ubuntu launched and ready for user log in: enter image description here

Step 7 is never reached.

Karl Baker
  • 181
  • 1
  • 1
  • 9
  • Sorry but it's not very clear where is the issue. What is happening when you run passwd ? – ob2 Mar 27 '19 at 22:12
  • I never get to run passwd username>. That screen/prompt never comes up. – Karl Baker Mar 27 '19 at 22:20
  • What kind of screen did you have after you pressed on F10? – ob2 Mar 27 '19 at 23:03
  • Did you try to just follow Jorge Castro's answer? – danzel Mar 28 '19 at 00:25
  • @danzel, Yes. But I never see the "Recovery Menu" screen. My image of it above is copied from his post. – Karl Baker Mar 28 '19 at 01:26
  • @ob2, the next screen is rapidly scrolling text as the boot process runs. The scrolling either stops at a certain point as described in OP or continues until the GUI log in screen appears, also as described. – Karl Baker Mar 28 '19 at 01:29
  • Did you edit the boot options before pressing enter? Please try an older kernel (one of the other ...(recovery mode) options). If that doesn't work, please attach a screenshot of the code that appears when you press e with the recovery mode option selected. – danzel Mar 28 '19 at 07:34
  • @danzel, here are screenshots of the unedited kernels. I did try editing them as described in my original question.

    kernel38 kernel39 kernel43 kernel46

    – Karl Baker Mar 28 '19 at 17:30

2 Answers2

6

The steps I had to take to reset my password differ somewhat from all the answers linked in the original post. I start out the same but never see a Recovery Menu screen, never enter "/usr/sbin/usermod -p '!' root", etc. I make changes at the command line but the behavior of my CLI is not predicted in any of the other how-tos I tried.

These steps were taken on a single-boot Dell running only Ubuntu 18.04:

  1. Turn on computer.
  2. Press and hold Esc key when Dell screen appears to enter GRUB (right Shift key didn't work for me; didn't try left Shift key).
  3. Select "Advanced options for Ubuntu".
  4. Press Enter.
  5. Select "Ubuntu ... (recovery mode)". I had four kernels and chose the latest one.
  6. Press "e" for edit.
  7. Navigate to the line that starts with "linux /boot/vmliuz-...". For me that line ends with "ro recovery nomodeset".
  8. Remove the last part of line, "ro recovery nomodeset", and replace it with "rw init=/bin/bash". (Thanks to faqforge website for making this step clear.)
  9. Press F10 to reboot the machine.

Here's where I will switch to narrating my experience in the first person rather than prescribing what others should do. I'm not sure why I never see the Recovery Menu at this stage that most answers indicate, or why my command line looks and behaves as it does, but in the end this worked for me where other checklists didn't. Maybe it will work for you too.

After a few seconds the boot process stops and displays this prompt:

root@(none):/#

I start typing "mount -o remount,rw /" but can only type part of the command before the system takes control and outputs this:

enter image description here

The cursor is dangling there, not yet back to a prompt, so I finish typing the command and hit Enter. The output looks unpromising --- it's got the word "errors" in it --- but I am returned to the prompt.

I try again and this time am able to complete the command, "mount -o remount,rw /". I press Enter and see the same output.

enter image description here

But I'm at a new prompt so I figure what the heck, let's try "passwd".

I enter "passwd my_user_name" and press Enter.

And lo and behold, I am prompted for my new password. I enter it, reenter it, and joy of joys, there's a message of success.

enter image description here

Back at a new "(none)" prompt, I type exit and hit Enter. From some checklists I tried, this is supposed to take me back to the Recovery Menu, but since I didn't see that screen on the way in it's probably asking too much to be taken "back" to it now :)

The boot process picks up for a few seconds, then gets hung up here:

enter image description here

After waiting a while, with no options I do a hard power down, figuring it's 50/50 if my new password survives.

On restart I let boot go thru the normal process. It takes longer than usual, but eventually gets to the gui log in screen. I enter my new password and ...

This immovable modal pops up: "Enter password to unlock your login keyring. The password you use to log in to your computer no longer matches ...."

enter image description here

Have I gotten this far only to be denied? I try my new password but of course it is not correct. I try a few more but of course they fail as well, b/c I don't know my old password! Now what?

And then I see it. A Cancel button, right there in the dialog box. I press it and voila, I'm in! Later I'll look into what the "login keyring" is, but for now I'll consider that the password issue is fixed. Hope this helps someone else out there!

Karl Baker
  • 181
  • 1
  • 1
  • 9
  • 1
    This is always the process I use, it works wonders. In fact, even OS X/macOS use a similar process (though you do Command+S to do it instead of GRUB) – SYGMAH Mar 30 '19 at 00:45
  • THANK YOU!!!!!!!!!! – Amit Hadary Jan 14 '21 at 12:22
  • 1
    The way to continue the boot process after changing the password is with the command exec /sbin/init which substitutes the bash shell where working on with the normal starting main process of the system, which in turn continues the normal boot sequence. – Fjor May 09 '22 at 19:47
0

I just verified that the steps here: https://wiki.ubuntu.com/RecoveryMode will get you to the shell prompt to reset the password.

After step 8, you will be able to enter the passwd <username> command.

  • Sadly, no. In step 6 when I press Enter the boot process begins. And continues. And stops only when the windows manager displays the GUI log in screen. So I never get to step 7. Question: Once I hit Enter in step 6, do I need to hold Shift or Esc again to get the boot to stop? – Karl Baker Mar 28 '19 at 04:26
  • see screenshots of the steps I took added to my original post. – Karl Baker Mar 28 '19 at 04:57