Forgot Ubuntu Login password? This handy tutorial will show you how to reset it. Tested on Ubuntu 13.04 Raring, should also work for Ubuntu 12.04 Precise and 12.10 Quantal.
It is important to choose not only a good and secure password, but also one that you can remember. If you have forgotten the password to log in to your computer account, you can follow the following steps to reset it.
1. Restart your computer, and hold down Shift during bootup to get into the Grub menu.
If you have a dual-boot machine and you choose at boot time which operating system to boot into, the Grub menu should appear without the need to hold down Shift.
2. Press the down arrow on your keyboard to highlight the line “Advanced Options for Ubuntu”
Then highlight the first line that ends with the words ‘recovery mode’, then press Enter.
3. Your computer will now begin the boot process. After a few moments, a Recovery Menu will appear. Use your down arrow key to highlight the line “root Drop to root shell prompt” and press Enter.
4. You may find that it said “filesystem state: read-only”, so you need to remount with read and write permission. At the # symbol, type:
mount -rw -o remount /
5. Then type this:
where username is the username of the account you’re changing the password for. Check it via ls /home
6. You will be prompted to enter a new UNIX password, and to confirm the new password.
7. Type reboot and press Enter in previous menu. Enjoy!