Howto fix the “edit home screen” loop for iPhone
Yes i’m one of those idiots who changed his password using passwd and my iphone got stuck in the infinite loop of “edit home screen”.
Fortunately for me i still had SSH access and i refused to restore my iPhone.
What you need to do to get out of the loop is restore the original password.
This can be done by editing the content of /etc/master.passwd en /etc/passwd
The content of /etc/master.passwd should be:
##
# User Database
#
# Note that this file is consulted when the system is running in single-user
# mode. At other times this information is handled by lookupd. By default,
# lookupd gets information from NetInfo, so this file will not be consulted
# unless you have changed lookupd's configuration.
##
nobody:*:-2:-2::0:0:Unprivileged User:/var/empty:/usr/bin/false
root:/smx7MYTQIi2M:0:0::0:0:System Administrator:/var/root:/bin/sh
mobile:/smx7MYTQIi2M:501:501::0:0:Mobile User:/var/mobile:/bin/sh
daemon:*:1:1::0:0:System Services:/var/root:/usr/bin/false
unknown:*:99:99::0:0:Unknown User:/var/empty:/usr/bin/false
_securityd:*:64:64::0:0:securityd:/var/empty:/usr/bin/false
and the content of passwd should be:
#
# 4.3BSD-compatable User Database
#
# Note that this file is not consulted for login.
# It only exisits for compatability with 4.3BSD utilities.
#
# This file is automatically re-written by various system utilities.
# Do not edit this file. Changes will be lost.
#
nobody:*:-2:-2:Unprivileged User:/:/usr/bin/false
root:*:0:0:System Administrator:/var/root:/bin/sh
mobile:*:501:501:Mobile User:/var/mobile:/bin/sh
daemon:*:1:1:System Services:/var/root:/usr/bin/false
unknown:*:99:99:Unknown User:/var/empty:/usr/bin/false
_securityd:*:64:64::0:0:securityd:/var/empty:/usr/bin/false
Either replace them with pico/vi/whatever or use winscp, yummyFTP(mac) or FUGU(mac)
after that reboot your iphone (just type reboot in the commandline) and you get one last “edit home screen” message.
Download a zip with the passwd files
Changing the password
So what if you do want to change the password.
Well since the passwd binary is not working (this causes the error above) we need to do things manually.
Note that i don’t now what will happen with a firmware upgrade / reset and so on. My advice is to use bossprefs to disable SSH when you don’t need it. It saves you a lot of trouble and things can’t go wrong.
With the following perl script you can change the password has. You need to run this on your own unix/mac computer.
perl -e 'print crypt("<PASSWORD>", "MM");'
Where
It should output something like: MM7OSdLyidopY
Now open /etc/master.passwd and change the hash for root to the new hash:
##
# User Database
#
# Note that this file is consulted when the system is running in single-user
# mode. At other times this information is handled by lookupd. By default,
# lookupd gets information from NetInfo, so this file will not be consulted
# unless you have changed lookupd's configuration.
##
nobody:*:-2:-2::0:0:Unprivileged User:/var/empty:/usr/bin/false
root:/smx7MYTQIi2M:0:0::0:0:System Administrator:/var/root:/bin/sh
mobile:/smx7MYTQIi2M:501:501::0:0:Mobile User:/var/mobile:/bin/sh
daemon:*:1:1::0:0:System Services:/var/root:/usr/bin/false
unknown:*:99:99::0:0:Unknown User:/var/empty:/usr/bin/false
_securityd:*:64:64::0:0:securityd:/var/empty:/usr/bin/false
It should now look something like this:
##
# User Database
#
# Note that this file is consulted when the system is running in single-user
# mode. At other times this information is handled by lookupd. By default,
# lookupd gets information from NetInfo, so this file will not be consulted
# unless you have changed lookupd's configuration.
##
nobody:*:-2:-2::0:0:Unprivileged User:/var/empty:/usr/bin/false
root:MM7OSdLyidopY:0:0::0:0:System Administrator:/var/root:/bin/sh
mobile:/smx7MYTQIi2M:501:501::0:0:Mobile User:/var/mobile:/bin/sh
daemon:*:1:1::0:0:System Services:/var/root:/usr/bin/false
unknown:*:99:99::0:0:Unknown User:/var/empty:/usr/bin/false
_securityd:*:64:64::0:0:securityd:/var/empty:/usr/bin/false
If you don’t have perl installed you can go to this website to generate a hash for your password:
http://iphone.simbunch.com/crypt.php





