Remember few weeks back ther was this Rick Ashley or somewhat iPhone virus that spreads around to whom ever that is connected to their 3G carrier? And the fix for it was to advise all iPhone users to change their DEFAULT root password alpine to something else.
Well as advise I changed mine and guess what? I forgot what did I change it to! It has been weeks since I have use WinSCP to remote into my iPhone to copy files until today I was trying all the combination of password possible until I give up and refer to GOOGLE! my saviour! it's my answer to everything.
The trick to changing your forgotten password is to hack the datastore that stores your password. Like all sensitive information, it's always kept somewhere to compare it against. For the iPhone's case it's stored under /etc/master.passwd
The guide has step 1 to 41 however after step 26 i abandone ship because it got damn complicated!
Well here are the REVISED instructions:
1. Open up cydia
2. Go straight to search.
3. Search for a package called iFile.
4. Install iFile.
5. Once iFile is installed close cydia and open up iFile.
iFile is a program that will let you browse, open, and maipulate files. This includes moving them. It dose this with root powers.
6. In iFile browse to the /etc directory (top left a few times, then find 'etc' and tap that).
7. Once in /etc/ scroll down to a file called 'master.passwd'.
8. Press the edit button (top right).
9. Tap on the letters 'master.passwd' that indicate the file 'master.passwd'. This should put a little red dot to the left of it.
10. Tap the icon/button thing in the bottom right (looks like an arrorw speeding out of a picure frame (or one of those pictures you get after roller coasters, upside down).
11. Select 'copy'.
12. Tap 'Done' (top left, where edit was).
13. Tap the home icon/button thing (bottom, second from the right, looks like a house).
Now you're in '/var/mobile' if I am correct.
14. Tap edit again
15. Tap that bottom right copy/cut/paste arrow-in-a-picture-frame button thing that you tapped before (I'd tap that).
16. Tap paste.
17. Tap the blue circle to the right of 'master.passwd'.
18. See where is says 'Ownership', followed by these two lines:
Owner root >
Group wheel >
tab on owner, change it to Mobile. Then do the same for Group. So you have:
Owner mobile >
Group mobile >
19. Close iFile.
20. Go to terminal
19. In the terminal (type pwd and make sure you're in /var/mobile, if it dosen't say '/var/mobile', type "cd /var/mobile" )
21. At the terminal type: grep ^root master.passwd
21a Something like this should appear: root:UlGq3RrXWDrOc:0:0::0:0:System Administrator:/var/root:/bin/sh
22. Take note of the string or random-looking letters and numbers between the first two colons (in the case above 'UlGq3RrXWDrOc') that is the password 'hash', an encrypted form of you password that cannot be unencrypted.
23. 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
Test crypt online . At that website you see a large text area with $str above it, and a one-line text input with $salt above it. In $str will be where you type your new password. Next click run.
24. You will get a result like what you previous hash was (note if you've done this a different way and get something that looks like: $1$Rt79jmd6$526Di9l3ra//YfQ7BvD./1 that's bad, that's why you're going wrong. It should be shorter and without dollar signs).
25. First backup the master.passwd you have in case do make a boo boo and have to start over. Do this by typing "cp master.passwd master.passwd.bak".
26. Go back to iFile
26a Make sure you are in the /var/mobile folder
26b Tap on master.passwd and iFile shall prompt to ask what application to review the file with? Select Text Viewer
26c Tap on Edit and replace UlGq3RrXWDrOc (as shown as the example above) with the new hash created from the website on step 23.
26d Tap Done
27 Tap Edit
28 Select the master.passwd file and copy the file by tapping on the arrow-in-a-picture-frame button
29 Go back to /etc/
30 Tap on Edit
31 Tap on Paste by tapping on the arrow-in-a-picture-frame button
Congratulations you successfully rooted your iphone and changed the password (wasn't exactly hard was it).