We have already showed you how to reset a forgotten password in CentOS. In this brief tutorial, we will see how to reset the lost or forgotten password in Ubuntu and derivatives.
Here, we will reset the lost/forgotten password of Ubuntu 14.10 server.
Power on the system. You should see the grub menu when booting your system.
Press “e” to edit the grub menu. The following screen should appear.
Find the line that starts with: linux /boot/vmlinuz….
Go to the end of the line and type: init=/bin/bash
Now, press CTRL+X or F10 to boot your Ubuntu system.
Once you reached the bash prompt, type the following commands to mount the file system in rw mode.
mount -o remount,rw /
Now, change the password using command:
passwd
The above command will reset your root user password. If you want to change the password of a specific user, for example sk, use the following command instead.
passwd sk
Reboot your system.
reboot -f
That’s it. Now, you can login using your new password.