I have already tried the root solution on the GBU thing, but it ask for the password: "Give root password for maintenance (or press control-D to continue)" Do you guys know any other way to recover it?

I use ubuntu 17.04

  • There's no way to "recover", there's a way to change it (but changing it won't allow access to your files if that's what you're looking for). – user692175 Nov 21 '17 at 23:24
  • 1
    I've used this method many times. askubuntu.com/questions/24006/… – troylatroy Nov 21 '17 at 23:26

Your password for using sudo is your account password. There is no separate sudo password. Your account needs to have sudo privileges. The account you set up for yourself when you installed Ubuntu will have been given sudo privileges.

If you don't remember your account password you will need to reset it which will require you to boot from a Live CD or into a special recovery mode, depending on which instructions you follow.

Some instructions for this are at: How do I reset a lost administrative password?

  • i have already tried the recovery mode but i always get trapped on the "Give root password for maintenance (or press control-D to continue)" question, since i dont know my password – Pedro Elias Nov 22 '17 at 0:05
  • If pressing Control-D doesn't help, try the alternate instructions here under "Alternate Root Shell Method". – thomasrutter Nov 22 '17 at 1:01

Based on thormasrutter link and the need to have such a wonderful solution here on AskUbuntu, here are the steps:

Alternative method when mounting root filesystem in rw doesn't work.

  1. Choose the regular boot kernel that you use (typically just the default one), and then use the "e" key to choose to edit that boot option.:

    enter image description here

  2. Now just hit the down arrow key over to the "kernel" option, and then use the "e" key to switch to edit mode for the kernel option:

    enter image description here

  3. You'll first be presented with a screen that looks very similar to this one:

    enter image description here

  4. You'll want to remove the ro quiet splash part with the backspace key, and then add this onto the end:

    • rw init=/bin/bash

    enter image description here

  5. Once you hit enter after adjusting the kernel line, you'll need to use the B key to choose to boot with that option:

    enter image description here

    1. At this point the system should boot up very quickly to a command prompt. You can use the following command to reset your password:

      • passwd <username>

    enter image description here

  6. After changing your password, use the following commands to reboot your system. (The sync command makes sure to write out data to the disk before rebooting).

    reboot –f


I found that the –f parameter was necessary to get the reboot command to work for some reason. You could always hardware reset instead, but make sure to use the sync command first.

Source and credits

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.