How Do I Change a Forgotten User Password Without Booting?

Solution 1:

No, that's not possible as that would defeat the purpose of a password-protected super-user account.

Boot recovery mode blindly

I recommend that you first try to boot to recover mode “blindly”, i. e. try to open the Grub menu and selecting the boot entry for recovery mode without actually seeing what you're doing. It may a few tries, maybe 10 or 20 until you find the right key sequence and timings. The secondary screen is going to start to work during the boot process probably. See How do I reset a lost administrative password? for general instructions and refer to this answer for the current structure of the Grub menu to reach the recovery mode entry.

The key sequence should be:

  1. Shift at the right time to cancel the countdown for the default boot option and to show the Grub menu (if it's configured to not show without user interaction). There should be no harm in spamming Shift every second or so after boot or, if supported and enabled, after the single beep that confirms a successful BIOS POST.

  2. (downwards arrow key) and Enter to select “Advanced options for Ubuntu.”

  3. In the sub-menu, (downwards arrow key) and Enter again to select “recovery mode.”

Reset password from Live DVD/USB

If you can't find the right key sequence or timings or the image doesn't show up on the secondary screen, you can reset the password from a live system.

  1. Create a Live DVD/USB (if you don't have one ready) and boot it as if you wanted to install Ubuntu.

  2. Choose the “Try Ubuntu” option in the boot menu.

  3. Open a terminal (Ctrl+Alt+T).

  4. Identify the device path of the partition of your Ubuntu installation. You can use (among other)

    • the graphical Gnome Disks application (sample screenshot) or

    • the terminal command:

       sudo lsblk -o NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINT
      

    You can recognise the right partition through properties like the size, the label (if you set one), and the file system type (“ext4” in a default installation).

    For the sake of simplicity let's assume that your Ubuntu installation is on the device with the path /dev/sda5.

  5. Mount the identified partition:

    • Gnome Disks has a “mount” button. In recent versions it looks like the playback symbol (▶) which is replaced by the stop symbol (■) when a file system is in mounted state.

    • On the terminal:

       udisksctl mount --block-device /dev/sda5
      

    On success both will show you the mountpoint, i. e. the path where the file system content is made available. Let's assume it's /media/my-ubuntu-installation.

  6. On the terminal run

    sudo passwd --root /media/my-ubuntu-installation <USERNAME>
    

    where you replace <USERNAME> with the name of your user account. Enter a new password when asked (twice).

  7. Reboot normally and you should be able to log in with that password and authenticate as super-user with sudo and friends.