Reset your root password

Last change 11/02/2010

It happens to the best.. and also to me.. jailbreaked iPhone/iPod Touch - ssh in as root - passwd.. and when you login next time.. what was my root password?? Here is a way to recover it :)

Jailbreaked IPhone - New Version

This will ONLY work if you jailbreaked your iPhone/iPod Touch (but hence you changed your password and ssh in your phone I guess thats covered :P)

Make sure to install:

  • gTxtEdit

it can be found and installed via cydia/icy


Then press open and use the path "/private/etc/master.passwd"

Then scroll to the line that says "root" an make sure it looks exactly like that:

root:/smx7MYTQIi2M:0:0::0:0:System Administrator:/var/root:/bin/sh

(make sure all uppercase characters are the same as well!!!)

save and happily login as root agian with the defualt password alpine.

Jailbreaked IPhone - prereq

This will ONLY work if you jailbreaked your iPhone/iPod Touch (but hence you changed your password and ssh in your phone I guess thats covered :P)

Make sure to install:

  • iFile
  • mobileTerminal (if you changed not only your root, but also your 'mobile' password)
both can be found and installed via cydia/icy

I only changed the root password!

This is easy. just ssh on your iPhone using the user 'mobile' (w/ default password 'alpine').

then create a symlink (because iCommander is pretty buggy):

ln -s /private/etc/master.passwd master.passwd

Afterwards - on your iPhone -  start iCommander - your will see a '@master.passwd' file click on the the little blue error to the right and in Permissions type in '666' and press 'Set'.

back in the terminal you can now edit the master.passwd ('nano master.passwd') and change it.

Set the password of root to: /smx7MYTQIi2M (whole line should be something like: 
root:/smx7MYTQIi2M:0:0::0:0:System Administrator:/var/root:/bin/sh
Then close it via Ctrl-X and then to save it.

Now you can login with root/alpine again :)

I only changed the root AND the mobile password!

This is a little trickier. but still pretty streight foreward. The only changes to above are, that you have to use the terminal instead of your computer with a nice keyboard to do all the steps above.

the trickiest parts are when you are in nano. Luckily you can just hold your finger longer on the black part of the terminal and a mini-menu opens up. There scroll your finger to 'misc' then to 'nano' and then to 'save' (let go) and again the same thing with quit.

 

Oh and you should change the line with 'mobile' as well:
mobile:/smx7MYTQIi2M:501:501::0:0:Mobile User:/var/mobile:/bin/sh


Site created with Corinis CCM