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.

d a i s y
  • 5,511
MohammedSimba
  • 848
  • 8
  • 20
  • 40

3 Answers3

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".

acer
  • 251
  • 1
  • 6
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

wjandrea
  • 14,236
  • 4
  • 48
  • 98
  • 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 02 '17 at 05:40
  • 2
    If you are using it on a local machine you have to start it with step 3 and onwards, thanks. – Saqib Ahmed Jan 02 '17 at 06: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].

Stephen M. Webb
  • 747
  • 5
  • 11
  • 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!!

    – MohammedSimba Dec 24 '13 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!. – MohammedSimba Dec 24 '13 at 17:25
  • 2
    It's not impossible to log in as root... – troylatroy Dec 24 '13 at 18:12