Is there a way to change root/user password in GRUB?

The old user password for Ubuntu Mate 18.04 (in dual boot with Windows)
seems not working. I wanted to change it in GRUB boot menu via:
password USER PASSWORD
and it didn't seem to change it.
Here're more details How to change root/user password in GRUB console?.
Is there a way to change root/user password in GRUB?

Like the others responded in your Ubuntu Forums thread, the GRUB password is not your login password. The GRUB password is intended to keep thugs from booting up your computer with unauthorized boot options; your login password is to keep thugs away from your user account.

As recommended in the other thread, booting in Recovery Mode should help you. However, one thing to note is that in some versions of Ubuntu, Recovery Mode still asks you for your password (for security). If you have such a version of Ubuntu (try it), you still have at least two options left:

  1. In the GRUB menu, press the E key to edit the usual boot entry. Press the down arrow key until you get to the line that starts with linux; append init=/bin/bash to the end of the command line. Press CtrlX. When you get to a shell prompt, type passwd [username], replacing [username], of course, with your username. Enter a new password, then press Ctrl-Alt-Delete to reboot.

  2. Alternatively, you can boot into a live CD/DVD/USB of Ubuntu and change your password from there:

    1. Boot up a live version of Ubuntu.
    2. Once you get to the live desktop, mount your Ubuntu system partition.
    3. Open a terminal.
    4. Type sudo chroot /media/ubuntu-mate/[name of partition here], replacing [name of partition here] with the name of the partition (it'll probably be the only thing mounted, try just pressing TAB at this point).
    5. Type passwd [username], replacing [username] with your username.
    6. Type in and confirm a new password.
    7. Press Ctrl-D twice to leave the terminal.
    8. Reboot.

Hope that helps!

1 Like

Here it is recommended 'to change the string “ro single” to ” rw init = / bin / bash “.' rather than append.

I'll try, but I think I will fail, because this Ubuntu 18.04 (installed in dual boot with Windows) is already on "high alert". After multiple unsuccessful attempts to enter user password, I rebooted from live CD into "Try Ubuntu" and probably tried change passw etc. Afterwards
it began to boot into "Try Ubuntu" default desktop with installed user apps and user previous desktop locked, and there was a readme.txt and passphrase file in the Documents to enter passphrase, which I sort of have written somewhere on a physical media, but available passphrases doesn't work. There was ~20GB free space left on this default "Try Ubuntu" desktop, so I installed a necessary user app and made updates from there for several months or a year, before long period of non-usage, which resulted in last previous working password not working anymore.

If this is due to a limited default number of incorrect password attempts,
is there a way to access a config file and change it?

Potentially I'd like to upgrade this dual boot to UBuntu 22.04, maybe I can also reboot from live USB/CD. enable networking and upgrade and somehow get the option to choose a new user password during upgrade?

Ouch. I think you need help from someone else. You've probably got an encrypted home directory, and your password is not just used to log in, it's used to decrypt your home folder! I've never succeeded in recovering the password used to encrypt one's home directory; you'd better reach out to others, and you might need professional data recovery.

I am actually interested why a working Ubuntu 18 password, although with user apps/Desktop locked under passphrase, after a relatively long period of non-usage stopped working. It was a sort of simple password and entering it was easy, so probability of multiple incorrect attempts should have been low. Are there some default values of incorrect password attempts/periods of non-usage etc upon installation or anything else?

You shouldn't be limited to a certain number of password attempts, at least by default. If you ever limited password attempts, you'd probably know, since it's a fairly involved thing to do. I thus figure it's unlikely that you locked yourself out of the system by exhausting your quota of password attempts.

Though, I have seen a weird bug in the old GNOME Screensaver (I'm not sure if it still affects MATE -- I think I reproduced it on MATE once), where under certain circumstances, no matter what password you type to unlock your screen, the screensaver just won't let you in, citing an "Incorrect password". The GNOME/MATE Screensaver also does limit you to just a few (4?) attempts at guessing your password, after which point the screen locker goes back on and you have to move the mouse again and try again.

If you changed your password via live CD yet have an encrypted home directory, then your login passphrase and your decryption passphrase no longer match, and your home directory is thus unreadable. Now, if you now remember what your old password was, then change it back, log out, log back in, and see if your files come back up. Chances are, they will.

So I appended init=/bin/bash to the end of the linux line, pressed ctrl+x, and changed the password from the shell prompt via passwd to the last working password. The shell threw some error passwd: Authentification token manipulation error Password uhnchanged and didn't reboot with another error, but did exit. Upon normal boot this password matched and I booted into "Try Ubuntu" desktop with some user apps installed available (which I used for a couple of months and then didn't used for a longer time) with 2 files in the home/user directory, regarding the locking of my original Ubuntu Desktop (i.e. home/user) directory (it was probably encrypted). They ask to enter a passphrase, and the 2 passphrases I have written didn't match.

When I powered on this notebook initially and tried to normally boot into at least "Try Ubuntu" desktop (without live CD/USB), there was a quick output of regular bootup console messages upon booting, and there was an 'ERROR:' message regarding failing to load kernel modules, check systemctrl something.

As it booted into last working desktop, is it possible to bypass the passphrase lockage?

As it seems to be another topic, I'll create a separate thread for this.