Change root passwd on iPhone 1.1.3

Mar 03, '08 07:30:03AM

Contributed by: Anonymous

I have never tried using the passwd command on my jailbroken 1.1.3 iPhone, since everyone warns of its use. However, I don't like having the default root password that everyone in the world knows, so I wanted to figure out a way to change it. It's pretty easy actually. On a Mac or Unix/Linux, the openssl command will do what you need like this:

openssl passwd -crypt -salt /s myNewPasswd
The password can only be eight characters long; anything longer will be truncated. I don't know if the salt has to stay the same or not, but to be safe, I just used the same salt as the original password. I doubt this makes any difference, though.

I ssh'd to the iPhone, and ran cat /etc/master.passwd, then copied that output to BBEdit (or other text editor). Then I replaced the passwd section (in between the first two colons) with my new hash for both root and mobile users. Finally, I copied the whole thing, switched back to the iPhone's ssh session and ran:
cat > /etc/master.passwd
I then pasted in the clipboard contents and pressed Command-D. That's it; the password was changed. I ran through most of my apps, put the iPhone to sleep, woke it up, and rebooted all without any problems. You don't need to reboot or do anything else for this to take effect.

[robg adds: I haven't tested this one.]

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20080224231344798