Password – Reset Owner Password on Ubuntu 18.04 Single-Boot Dell Laptop

18.04bootgrub2passwdpassword

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.

Best Answer

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!

Related Question