0

I have an ASUS eee pc that I bought second hand. It had the password of the previous owner/administrator, and was running Ubuntu 12.04. I previously asked how to reset the password, and I took what appeared to me the easiest way to reset the password.

I was told to press the left shift key when turning it on. I did this and I then went to recovery mode, as instructed. It asked for the new Linux password. I gladly typed in my name, and it was blank where I was typing. You see, I had no idea it was supposed to be blank.

So, now I have a new dilemma. I have no idea what I typed in for a password, and when I attempt to go to recovery mode to select a new password, it doesn't ask for a Linux password, but instead I see this message:

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

What can I do to fix this?

  • 1
    Why not just reinstall? – TheWanderer Jul 28 '16 at 13:49
  • You can reset the password one more time and try to remember it. – Pilot6 Jul 28 '16 at 13:49
  • @Zacharee1 Why reinstall? – Pilot6 Jul 28 '16 at 13:50
  • 1
    It'll be less hassle than resetting the password, and it'll get rid of the stuff from the previous owner. @Pilot6 – TheWanderer Jul 28 '16 at 13:50
  • 1
    Please chose informative titles for your questions. "Need help" doesn't tell us anything about what you need so most people will just ignore your question. Also, adding paragraph breaks makes your question much easier to read, further increasing your chances of getting an answer. – terdon Jul 28 '16 at 13:53

1 Answers1

0

If you have set (and then forgotten) a passwood for the system's root account, then you will need to work a little harder to reset other passwords.

Fortunately you appear to have mastered the (IMHO) trickiest part - which is hitting the SHIFT at the right time to get into the grub menu:

grub menu

At that point, instead of choosing Ubuntu, with Linux X.Y.Z-NM-generic (recovery mode), press the e key. You should see a screen like

grub edit

Use the (down arrow) key to scroll through the box until you find a line that starts with

linux /boot/vmlinuz-X.Y.Z-NM-generic 

and ends something like

quiet splash $vt_handoff

grub edit boot entry

and position your cursor at the end - it may appear split over two lines using a \ at the end as seen here, but it's really one line. Then add the following

init=/bin/bash

(after a SPACE) so that it becomes

grub init shell

Now exit the grub screen by hitting CTRL+X


You should now be in a root shell just as though you'd entered recovery mode with either no or a valid root password. From here on in, the reset instructions are exactly as before i.e.

  1. remount the root filesystem in read-write mode

    mount -o remount,rw /
  2. change the password of your sudo (administrative) user

    passwd someuser

Although you don't have to do it here and now, you might want to restore the locked (passwordless) root account so that you don't need to jump through these hoops again next time

  1. passwd -l root

(that's a lower-case 'ell', not a 'one'). When you are done, reboot the machine

  1. reboot
steeldriver
  • 136,215
  • 21
  • 243
  • 336