Remembering a lot of accounts and password is a tiring job for a system administrator. Usually there would be a time that you'll forgot a certain password or worst is the log in username itself. Add this with the fact that you forgot to jot it down on a piece of paper or save it on a notepad text for your future reference.

Recover the Login Account in Ubuntu Shell

So in order to recover the said password (or account), all we need to do is to access the root account and, probably, replace the password you have placed for an Ubuntu account.

Steps on Logging in as Ubuntu without the Root Password

  1. First thing to do is to reboot your computer.

  2. Next is to hold down the Shift key at the start of the boot process in order to enable the GNU GRUB boot menu.

  3. Select the image you want to boot and press e to edit. (Correct me if I'm wrong but this seems to be the uniform in all distro)

  4. See if you can see any line that starts with kernel and append rw init=/bin/bash at the end.

    Some distro like 10.04 (Lucid Lynx) may have a different set of commands. In this case look for a line that starts with linux and append init=/bin/bash at the end.

  5. Press b (or Ctrl+x, depending on version) to boot.

  6. Your system will boot up to a root shell without password.

NOTE: On some version, a rescue mode or recovery mode option should be visible and choosing this should bypass steps 3-5

Changing the password of the account

  1. Make sure that you know the username of the account that you want to change.

    If no, you can always browse the /home folder to view it. (I'm not exactly sure if there is a better way of listing the users but so far this is what I have tried)

  2. Type passwd [username] and you will be prompted to enter and confirm your new password.

  3. This should reset your password and now you can normally return to the normal flow.



No comments :

Post a Comment