# Reboot the Ubuntu system and hold the shift key to enter the GRUB boot menu
# Select the Advanced options for Ubuntu and press Enter
# Choose the recovery mode option (usually ends with "(recovery mode)") and press Enter
# In the recovery menu, select the root (or root Drop to root shell prompt) option and press Enter
# Mount the file system in read/write mode:
mount -o rw,remount /
# Reset the password:
passwd username
# Replace "username" with the actual username for which you want to reset the password
# You will be prompted to enter a new password, provide a new password and confirm it
# Once the password is reset, reboot the system:
reboot