After publishing How to reset passwords on Fedora 21 and 22, I thought it was appropriate to do the same for Ubuntu 14.10.
So this tutorial will show how to reset a password on Ubuntu Desktop 14.10. It should also work on earlier editions, like Ubuntu 14.04, and even on the upcoming Ubuntu 15.04.
The obvious reason you might want to reset your password is because you forgot it. If you did not configure full disk encryption and/or password-protect GRUB, the bootloader, anybody with physical access to the computer can reset the password. It’s that simple and a good reason you should always encrypt your disk and password-protect the bootloader.
Now that you know why you should make it impossible for an unauthorized person to reset your Ubuntu Desktop password, let me show you how you can do it, if you ever forget or lose it. Note that attempting to reset the password involves booting into what is known as single user mode. That mode gives you superuser access and privileges.
To begin the process of resetting your password, you, of course, need to have physical access to the computer. So reboot it. When the GRUB splash screen shows, press the ESC key on the keyboard. The GRUB boot window should now be visible. Figure 1 shows what it should look like on a computer with a standalone installation of Ubuntu Desktop 14.10. Select the default entry, if it is not already selected, then press E to edit the options.
The editable options for the selected entry should now be visible. You only need to edit one line, but you’ll have to scroll down to see it.
To scroll down, keep pressing the Down arrow on the keyboard until you see a line that begins with linux, linux16 or linuxefi. Figure 3 shows the line on my test installation.
To cause the system to boot into single user mode, you need to append rw init=/bin/bash to that line. Afterwards, reboot by pressing Ctrl X.
The system should reboot into single user mode. You can tell that it has when your screen looks like the one shown in Figure 5. And the command prompt will be that of root, so you have root-user privileges.
To reset the password, type passwd followed by the target username. In the example shown in Figure 6, I reset the password of a user named kamit. Note that you’ll be prompted to type the password twice. If the password-reset attempt is successful, the system will output passwd: password updated successfully. You may now reboot the computer by typing /sbin/reboot -f
That should do it. This procedure should also work on a distribution like Linux Mint, which is based on Ubuntu.