(Use at your own risk!!!!)
Step-by-step Process:
- Open up VMware Player then load your backtrack VM you lost the 'root' password for, then start the virtual machine
- Click inside the VMware Player window and when the virtual machine starts to load, hit your "Esc" key a bunch of times to enter the Boot Menu
- On the VMware Player menu bar Click "Devices" then "CD/DVD" then "Connect to Disk Image File (.iso)..."
- The Choose Image window will appear. Select the original bt4.iso you used to build your VM with. After your select the .iso image, the window will close.
- In the Boot Menu window, use your arrow keys and select CD-ROM Drive (this will boot the .iso image that is attached to our virtual CD-ROM) then hit the "Enter" key
- The default bt4.iso image will boot up and eventually dump you into a root shell prompt (if using final version of bt4)
- Create a temporary directory to mount the local hard drive to
- mkdir /a
- Mount your local hard drive to the new temporary directory
- mount /dev/sda1 /a
- Now remove the hash value for root in your local hard drives /etc/shadow file
- vi /a/etc/shadow
- Remove the hash contents (should look similar to example below:)
- root:(remove contents between these colons):11111:0:99999:7:::
- Now unmount /a, disable the .iso boot image, and reboot your system
- umount /a
- Click "Devices" then "CD/DVD" then "Disable Disk Image..."
- sync; init 0
- Open up VMware Player again, load your bt4 virtual machine and login with root and NO password!
- That's it!!!
Ray,
ReplyDeleteWow, thanks brother! Worked like a charm. (on BT 5 GNOME). Strangely enough, I couldn't find anything else like this on the web (didn't look too terribly hard). I got a VM from a lab and then realized that they changed the default password. :/ Thanks for your help.
No problem, glad it worked for you! There are other ways of doing it (like, using strings and pattern searching against the vmdk) but I thought this way was the most practical.
ReplyDeletegood catch..
ReplyDeleteBut after removing hash content. I duno what to do..i can move cursor through out the file but i dont know how to save changes. Sorry thats a noob question but i really want a work around..
P.S: i am using BT5 GNOME - 64 bit.
cheers
Sounds like you need to practice some vi kungfu ;-) 1.) Remove the hash 2.)Save the file by hitting the "Esc" key, then type ":wq!" and hit "Enter". The wq! means to write the changes and quit out of the vi editor. You can always fall back on the man pages for vi. Hope this helps.
ReplyDeleteThank you very much Ray! worked like a charm, in VirualBox.
ReplyDelete