Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-22-2013, 10:43 PM   #1
LQ Newbie
Registered: Aug 2013
Posts: 1

Rep: Reputation: Disabled
resetting the root password

i loose my root passwd long time back, and i installed Ubuntu 12.0 in a virtual machine, i have tried with grub menu to break the root passwd ...but it wasn't accessible! can anyone help me out of this?

thanks in advance

Old 08-22-2013, 11:13 PM   #2
Registered: Apr 2013
Location: Brazil
Distribution: Arch Linux
Posts: 137

Rep: Reputation: Disabled
I won't be able to help you recovering your password, but if I may suggest: Type the password a few times so that you don't forget it, that will help remember it.
It may help to write it down and type it a few times to remember it, then do whatever you feel safe with the paper to destroy it =p

Another tip: Make a password that will be easy for you to remember but hard for other to guess. Example:

1- Take a song you like and that nobody will be able to guess which.
2- Now take part of it's lyrics and transform them in a password. So, if the lyrics are "You'll take my life but I'll take yours too", take every initial letter and make it "ytmlbityt", and if you're more confident make it with symbols, upper case and numbers, so it would look like "ytM1l%b=iw[ty2". This is very useful if you want to create a strong password that is easy to remember.

I use the method above to create my encryption passwords. All of them are 64 characters long randomly generated using the method I described, but with almost no key repetition. So, they look like "_xJ3Bo9<A1.lcv7>0pPHy5Va,jbC2Z(iOp+4MXK" but 64 characters long. It ensures that no brute-force attack will be successfull even if all the computational power was put into brute-forcing it.

If you like this subject feel free to read other threads of mine in which forensic experts discuss it =)

Last edited by junior-s; 08-23-2013 at 02:36 AM.
Old 08-22-2013, 11:58 PM   #3
Registered: Aug 2012
Location: Kentucky, USA
Distribution: Slackware
Posts: 97

Rep: Reputation: 27
There are a few methods I have found - maybe one will work for you.
  1. If you can log into your Ubuntu virtual machine as a normal user with sudo priviledges, do so and open a terminal and type:
    sudo passwd root
    It should first ask for your own user password, and then a new root password you'll need to type in twice.
  2. If you cannot log into your VM as a normal user with sudo priviledges, I would suggest booting up your Ubuntu virtual machine with a Linux CD distro image (such as Puppy Linux or Knoppix) in the virtual CD drive for that machine. If you successfully get Puppy Linux or Knoppix or whatever booted, I would next open a terminal and mount the root virtual partition Ubuntu is installed on (assuming it's listed as sda1):
    # mkdir /ubuntu-mount
    # mount /dev/sda1 /ubuntu-mount
    I would then navigate to the /ubuntu-mount/etc/shadow file and open it in the editor of your choice. It might look something like this:
    The trick is to delete, on the line starting with "root", everything between the first two colons. So in the end the root line will look something like:
    You can then save the file and reboot into Ubuntu. There is no longer a root password (just hit Enter whenever it asks for one), and you can create a new password once back in Ubuntu. Just log in as root and give the "passwd" command.
Hope this helps!
1 members found this post helpful.
Old 08-23-2013, 02:31 AM   #4
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
lets do it a proper way:
i have tried with grub menu to break the root passwd
so tell us how you gone with grub.. to reset password and how it didnt worked.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Resetting root password emon1025 Linux - Newbie 2 10-26-2012 11:21 AM
resetting root password invader44 Slackware 1 08-04-2009 03:57 PM
resetting th root password on rh9 hamza11050 Linux - Software 4 09-30-2004 07:21 PM
Resetting Root password lorddecker Linux - Software 4 06-18-2004 02:48 PM
resetting root password. Reaps^ Linux - Security 1 07-06-2003 03:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration