How To: Change Your iPhone’s Default SSH Password

ikee_iphone_wallpaper

If you jailbreak your iPhone, the first thing you ABSOLUTELY MUST DO is change the default filesystem password.

When you jailbreak, the filesystem’s password is set to the common password “alpine.” As people usually don’t bother changing this password after performing a jailbreak, it’s really easy for hackers to get access to any jailbroken iPhone/iPod Touch on a public network.

EDIT: Just confirmed with GeoHot and it seems that at least blackra1n doesn’t install SSH by default, therefore this should not be a problem if you used blackra1n to jailbreak, unless you installed the OpenSSH package from Cydia.

An Australian hacker called Ashley Towns demonstrated this by circulating the first known iPhone worm, known as Ikee, which replaces your lockscreen wallpaper with an image of Rick Astley. Luckily Town’s Rickrolling is benign. He wrote the worm to demonstrate how easy it is to break into jailbroken iPhones.

Changing the password is quick and easy — after the jump is a tutorial showing how to change the SSH password.

Note: There is no need to follow this guide if you haven’t jailbroken your iPhone/iPod Touch.

Ingredients:

Jailbroken iPhone / iPod Touch
Cydia
MobileTerminal

Here’s how to change the default SSH password after jailbreaking:

SSH-PW-0

1. Make sure you have Cydia installed on your jailbroken device. If you don’t already have MobileTerminal installed, launch Cydia and tap the ‘Search’ tab in the bottom navigation bar.

SSH-PW-1

SSH-PW-2

SSH-PW-3

SSH-PW-4

SSH-PW-5

2. Type ‘MobileTerminal’ in the search field and select the first result. Select ‘Install’ on the top right corner and tap ‘Confirm’ on the next screen. It will now install MobileTerminal on your device. Now, tap on ‘Return to Cydia’ and tap home button.

SSH-PW-6

3. Navigate to the newly installed ‘MobileTerminal’ application and tap to open.

SSH-PW-7

SSH-PW-8

SSH-PW-9

4. In MobileTerminal, type ‘su root’ and tap return. It will ask you for a password, enter ‘alpine’ and tap return again.

SSH-PW-10

SSH-PW-11

SSH-PW-12

SSH-PW-13

5. Now, type ‘passwd’ and then tap return. Type in a new password such as ‘secret’ and tap return. Retype the new password to confirm and then tap return one last time to change the password.

6. Now, your SSH password will be changed and your device will be protected against any future hacks that use SSH to access your device.

  • john

    For me, it’s launching then shutting down immediately.

  • Justin

    you need to download the new moble terminal from http://code.google.com/p/mobil… for it to work. The one on Cydia doesn’t work with newer devices

  • furfree

    try to download it from the xsellize source, (http://cydia.xsellize.com) direct to the phone.

  • Enemy07

    cydia:manage: sources: edit: add: http://www.ijailbreak.com/repo

    search: mobileterminal: click first one (Not UKIT based one)

    go through same steps listed as above.

  • Sahanatrymytech

    i Tried but i am getting some problem in it..like it restarts again and again

  • salsaman

    Worked for me, thanks!

  • b0mbjack

    if it’s crashing try downloading Mobile Terminal (iOS4) – worked for me. thanks for the article.

  • Idkjhjuj

    load from xsellize on cydia and it worked first time! Thanks

  • EagleyeSmith

    So, I’m confused, if you jailbreak you iPhone, do you have to change your password? Or is it only if you install OpenSSH?

  • chrimux

    usually root is never enabled on apple devices (except for mac os x server). if you jailbreak your iphone, this process also enables root and sets the root password to “alpine”. (and apparently also the password for user “mobile”)
    You need ssh to get a command line into the os which enables you to change the root password on your jailbroken device to something else but “alpine”.

  • annamagtrends

    Thanks… :) helped…

  • ??????? ??????

    thanks a lot

  • Stewart NFS

    I just got Terminal from there and now when I go to remove it it crashes when it gets to “M” in packages.

    EDIT: Ah nvm I had removed the source first… It’s fine now. (Remember I just started literally 10 minutes ago).

  • kc

    If you cannot run the MobileTerminal app (it doesn’t really work well on iOS3+), then you can reset your password from your computer. Also, be sure to have installed OpenSSH from Cydia otherwise it won’t work either. The following link provides instructions about how to change your password: http://lastplaceonthe.net/chan

  • Jackdaniels

    It is now SU > ‘current password’
    then reset it with ‘passwd’

  • Jack P.

    HERE’S WHAT YOU DO NOW:
    Go to ifunbox.com
    Download iFunBox
    Run
    Go to SSH Terminal
    type in passwd
    Type in your new password
    Type it again
    You’re done! If you wanna test just to make sure, launch your SSH client (CuteSSH, WinSCP, CyberDuck)

  • Ilya Ershov

    Thank You!

  • Ashish Rai

    Thanks a lot 

  • Jason M Rice

    How do I change the user password?

  • John Kus

    One easy and safe way to change the root AND the mobile password on newer ios devices ,where newer = > ios 4 , is :http://www.youtube.com/watch?v=mEtdtdXfUWs , just did it and it works fine on my iphone 4 – ios 5.1 ……….

  • Matthew Nicholas Kennedy

    this worked out great for me. First time no problems simple and easy thanks a lot.

About the author

Sayam AggarwalSayam Aggarwal is a 18-year-old student living in India who has been an Apple fan for almost 5 years. He has worked with ModMyi, one of the leading iPhone communities, as an author for more than a year. He spends most of his free time on the Internet fetching the latest news regarding Apple and its entire product range. Follow him on Twitter!

(sorry, you need Javascript to see this e-mail address)| Read more posts by .

Posted in How-To, iPhone 3G, iPhone 3G S, iPod touch, Top stories |