25.4k views
3 votes
How to reset sudo password in ubuntu

User K Hein
by
7.8k points

1 Answer

5 votes

Final answer:

To reset the sudo password in Ubuntu, you can modify the grub command line and change the root password.

Step-by-step explanation:

In Ubuntu, to reset the sudo password, you can follow these steps:

  1. Boot your Ubuntu system and press Esc when the Grub menu appears. This will bring up the Grub menu options.
  2. Highlight the default kernel option and press e to edit the command line.
  3. Scroll down to find the line starting with linux. At the end of this line, add init=/bin/bash.
  4. Press Ctrl+X or F10 to boot with the modified command.
  5. You will now be in a root shell prompt. Type passwd and press Enter to change the root password.
  6. After changing the root password, type sync to flush any buffered data to disk.
  7. Reboot your system by typing reboot and pressing Enter.

Once your system restarts, you will be able to use the new root password to execute sudo commands.

User Markhorrocks
by
7.6k points