Recover forgotten iPhone root password

If your like me and changed your root password for security reasons after reading about exploits to Jailbroken iPhones, then you may have forgotten what you had changed the password to.
Our objective is to get root write control to the file system so you can change the root password in /etc/master.passwd back to something that you know. This should be simple as all apps run as root. We do this by first installing iFile.
- Open up cydia
- Wait for it to do that "Loading data" bit and hope that it's loading something more than 'home' because you're just going to go straight to search.
- Search for a package called iFile.
- Install iFile.
- Once iFile is installed close cydia and open up iFile.
iFile lets you browse, open, and maipulate files. This includes moving them. - In iFile browse to the /etc directory (top left a few times, then find 'etc' and tap that).
- Once in /etc/ scroll down and tap on the file called 'master.passwd'.
- Select Text Viewer in the screen that pops up, then click the edit button.
- find the line that looks like root:UlGASB5XWDrOc:0:0::0:0:
- The part we need to edit to change your devices password is between root: and the first :0
- Next you want to generate a new password hash. You can do this with the perl function 'crypt'. If you've no idea what that is head over to Crypt Tool online . At that website you see a large text area with $str above it, and a one-line text input with $salt above it. $salt can be any two characters. In $str will be where you type your new password, go ahead and do that, and salt. Next click run.
- You should get a result like what you previous hash was, it should be without any special characters.
- Replace the text between root: and the first :0 with your generated hash. Be careful to copy it exactly.
- Click the Save button at the top of iFile screen, then Click the Done button.






Comments
Thanks so much!
Thanks so much!
thank you !
thank you !
master.passwd is empty...!
What do one do when the master.passwd file is empty?
What version of iOS do you
What version of iOS do you have on your phone?
what should i put in $salt?
what should i put in $salt?
$salt can be any two
$salt can be any two characters.
thanks! worked great!
thanks! worked great!
Password trouble...
Thanks for the tutorial, but I can't seem to get it right. The only difference I see in my scenario is that there is a forward slash right after "root:", the 13 characters that have to be changed, and then on with the :0, etc. I tried both leaving and removing the "/" to no avail. I am trying to log in via FTP and can't get in. I am on an iPhone 2G running 3.1.3. Thanks for any help you can give.
Thanks!!!!!!
Thanks!!!!!!
THANK YOU!
Thanks so much! This worked like a charm.
Hi i did what you said but
Hi i did what you said but when i log in with su in mobile terminal it still says wrog password am i doing something wrong? please email me please michael_viteazul@yahoo.com
Reply
That is just excellent. You have provided some very usefule information here for us, thanks.
Recover deleted Iphone Messages
Question
Recover deleted iphone messages
Does this work on 4s?
Does this work on 4s?
Thanks
ItSupport Costs
Tom
Thank you :)
Thank you so much. it's work on iOS 5.0.1!
Thanks this work,,
Thanks this work,,
Great for you!!!
Does it work in iOS 5.1.1?
Followed the steps, two times, even rebooted, still no joy... Ipad2 iOS 5.1.1