Changing iPhone’s default password
This is a little post to show you how to reset your default root password after jailbreaking your iPhone/iTouch/iPad !
(This works for any iOS jailbroken device on any iOS version)
There are two ways to do this, first way is to do it via SSH, the second way is via mobile terminal.app
1st method:
- You need to have OpenSSH installed on your device, to do this, just install the package “openssh” from Cydia
- Get your device’s IP address (Settings->WiFi) then tap on the blue arrow next to your WiFi connection and get your IP
- Connect to your device via SSH using any computer in your network, open up your terminal (cmd) and type the following
ssh root@192.168.1.2If this is the first time you connect to your device, you will see the following message:
The authenticity of host '192.168.1.2 (192.168.1.2)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx Are you sure you want to continue connecting (yes/no)? yesJust type “yes” and hit enter
Warning: Permanently added '192.168.1.2' (RSA) to the list of known hosts.You will next be asked to enter your password, the default root’s password is “alpine”
write alpine and hit enterroot@192.168.1.2's password:You will be then logged in to your device !, you shall see something similar to this:
mostafa-bergs-iPhone-4G:~ root#Now you should change your password by typing in the command “passwd”
passwdYou will then be asked to type the new password, do that twice (make sure you don’t forget/loose the password)
Changing password for root. New password: Retype new password:
Congratulations!, You’re now safe from attacks.
2nd method:
Assuming that you can’t use SSH, so we’ll use the terminal on your phone directly !
- Install terminal.app (if you don’t already have it) by searching for “MobileTerminal” in Cydia
- Depending on your terminal, you can be logged in as a different use (“mobile”, “root”, etc…)
To know your current user, type in:
whoami
if it says “root” then you’re ready to go to step 5 , if it says anything else, proceed to step 3 ! - Switch the current user to “root” by typing “su” or “su root”
- The terminal will ask you for a password, which will be “alpine”, type it and hit enter !
- Now it’s time to change your password, type in the command “passwd”
passwd - The terminal will show something similar to this:
Changing password for root.
New password:
- Type in your new password twice and you’re done !
Congrats again !, you’ve done it.
Changing your root password is a must, anyone in your network can access your iDevice and control everything on your gadget if you’re not secured !, after following this little tutorial you’ll be really safe to go and play outside.
2 Comments

isn’t there any way to change alpine without having to do it via mobileterminal?
it seems one has to go via that non-updated program whether one accesses the phone via ssh or terminal.
this week, i’ve jailbroken 4x and every time, it’s mobileterminal that crashes upon launch, prompting me to install an old debian file (MobileTerminal_520-1_iphoneos-arm.deb) in order to get mobileterminal to work
then, after installing it, the phone starts crashing/resetting springboard/booting into safemode, etc
i’ve been jailbreaking all week, and the same exact problem always points to when i get mobileterminal to work, via this …-arm.deb file (which is necessary to install to get mobileterminal to work)
my only option at this point is to either not jailbreak, or turn off wifi whenever i leave my home network
i’d appreciate any suggestions you might have
thanks!
shelltops
Hey there !
Well , there’s a simple solution, you don’t need the MobileTerminal, you can just login via SSH !
Another thing, You can always turn off the SSH server using the SSH SBSettings toggle !
The SSH server runs on 3G too, so even if you turned off your wifi, you can access your iPhone/iPad from the internet !
I prefer to keep the SSH server on so I can get into it anytime i need (download files or wipe the phone if it gets stolen, or just simply find where the phone is via GPS, but that’s a more advanced topic)
Thanks for your interest, if you have other questions let me know