14

I lost my root/super user password on Ubuntu server. I tried to boot in a recovery mode and select option drop to root shell.

But it is always asks for:

Give root password for maintenance (or type Control-D to continue)

and I don't remember it.

2

3 Answers 3

8

Try Control-D when it prompts you for the root password. If that doesn't work, then try this:

https://www.howtogeek.com/1287/reset-your-forgotten-ubuntu-password-in-2-minutes-or-less/

Then scroll down to "Alternate Root Shell Method".

2
  • Thanks for that, it helped me. It was a little "grub" window different from mine, but i could use it to fix mine. Thanks alot. Dec 24, 2013 at 17:11
  • This works for Ubuntu 20, just a few things need changing in the link. May 14, 2023 at 1:04
4
  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. As soon as the boot process starts, press ESC to bring up the GRUB boot prompt. You may need to turn the system off from the control panel and then back on to reach the GRUB boot prompt.
  3. You will see a GRUB boot prompt - press "e" to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots).
  4. Find the kernel line (starts with linux /boot/) and add init="/bin/bash" at the end of the line.
  5. Press CTRL-X or F10 to boot.
  6. System will boot and you will see the root prompt. Type mount -rw -o remount / and then passwd to change the root password and then reboot again.

Reference: https://www.vultr.com/docs/boot-into-single-user-mode-reset-root-password

2
  • Note that these instructions are specifically about a Vultr cloud server. They may not apply to a local machine running a standard Ubuntu image, but I'm not sure.
    – wjandrea
    Jan 2, 2017 at 5:40
  • 2
    If you are using it on a local machine you have to start it with step 3 and onwards, thanks. Jan 2, 2017 at 6:45
-2

There is no root password in Ubuntu. This is a security feature: it's impossible to log in as root, no password means there is no password that can be cracked.

When prompted for the password in recovery mode, just hit [enter].

3
  • I know i can't log in as a root, i meant the administrator account of mine, i forgot it. and bout the root, when it asks me for the password, i did put to the role "root" a password, i don't remember it either!! Dec 24, 2013 at 17:07
  • I can't login as root to a desktop, but in case of server "which i am asking for" it is normal to login as a root!. Dec 24, 2013 at 17:25
  • 2
    It's not impossible to log in as root...
    – troylatroy
    Dec 24, 2013 at 18:12

Not the answer you're looking for? Browse other questions tagged .