If you ask me the top reason for jailbreaking iPhone, the ability to use SSH to transfer files between iPhone and computer via WiFi is my answer. I believe it’s also one of the reasons why some of you go for the jailbreak. But, as I know, not all the readers are geeks and come from technical background. You may even not heard of SSH until you decide to jailbreak. So, here is a short guide to show you how you can use SSH on iPhone and use it for transfer any files to your computer (Mac / Windows). The guide is completely target for non-technical person. I just want to show you how great SSH is when pairing with iPhone for wireless file transfer. So, you can use it to transfer ringtone and photos without the USB cable.
So, what’s SSH?
The first thing you would like to know is what SSH is. SSH stands for secure shell that is commonly used in Unix/Linux environment. You can use SSH to access a remote a computer and execute commands from another machine that may be miles away. Additionally, you can use it to transfer files to the remote computer, just like FTP. I’m not going to dig deep and throw out all the technical details about SSH. But just remember, SSH is a tool that lets you access machine or devices remotely. Here, the device is your iPhone.
Installing SSH on iPhone
You may be curious why you can use SSH on iPhone. Is SSH just designed for Unix? That’s a good question. You may not know the iPhone OS is a stripped-down version of Mac OS X, which is actually riding on Unix as its core. So, that’s why you can use SSH on iPhone.
But officially, Apple didn’t bundle the utility for every iPhone user and thanks to the jailbreak community to bring SSH to iPhone. As long as your iPhone is jailbroken, you can install and use SSH on iPhone.
To use SSH after jailbreak, you can go up to Cydia and search for “OpenSSH” to find the package. Tap the Install button to install it on your iPhone. Once installed, restart your iPhone. You’ll not find an icon for SSH on the home screen. But after restart, the SSH tool will be automatically launched and listens for remote request in background.

Note: Did you set the auto-lock? Your iPhone should be turned on during the SSH file transfer. So, if you have configured auto-lock, I suggest you to disable it before using SSH. You can go to Settings -> General -> Auto-Lock and set it to Never.
How to Transfer File Using SSH
Okay, here comes to the core part of this guide. How can you transfer file to & from iPhone remotely with WiFi? Now, your iPhone is already enabled with SSH and listens for incoming SSH request. Before you can transfer file from your computer to iPhone, you have to know the IP address of your iPhone.
To check for the IP address, go to “Settings” -> “Wi-Fi”. Tap on the connected WiFi network and view the details. You’ll see the IP address of your iPhone. Say, for my case, the IP address is 10.0.1.5.

Once you know the IP address, the next step is to connect to iPhone from your PC or Mac.
For Windows User
For Windows users, I highly recommend you to download WinSCP, which is a free SSH client for Win XP/Vista. You can download it for free from here.
Installation of WinSCP is very straightforward. Just double-click on “winscp421setup.exe” and follow the instruction to install it on your PC.
Once complete the installation, launch WinSCP and click “New” to connect to iPhone. In host name, type in the IP address of your iPhone. For user name and password, you can use “root” and “alpine” respectively. Keep other fields unchanged. You can then click “Login” to start making connection with your iPhone. Click “Yes” if you’re prompted with a warning to add the host key to cache.
Tip: Instead of clicking “Login” directly, you can click “Save…” to save the connection profile for future use


When connected, you’ll see the files in iPhone file system. And, you can easily transfer files between iPhone and computer by just drag & drop the files in WinSCP.

For Mac User
Mac is SSH-friendly. There is already a SSH client bundled inside Mac OS X. But you can only use it in command mode only as it does not offer a graphical interface. So, I highly recommend you to download a free SSH client called “Cyberduck” to connect to iPhone. You can download Cyberduck via this direct link or via its homepage.
To transfer files to iPhone, simply launch Cyberduck and click “Open Connection”. Then fill in your iPhone’s IP address in “Server” field. And use “root” and “alpine” for user and password respectively.

Next, click “Connect” button to connect to iPhone. And, Cyberduck will start establishing connection with your iPhone.
Make sure your iPhone is turned on. Otherwise, your Mac will fail to make the connection.
Once connected, you’ll see the folder list of your iPhone file system. You’re free to navigate through the file system. To download file from iPhone, just right-click on any file you want to download and select “Download To..” to retrieve the file. And, to transfer file back to iPhone, simply go to the destination folder and right-click to select “Upload”. That’s it!

Further Information
I hope this guide is helpful for you and you can find SSH useful for iPhone. Now, to further enjoy the benefit of SSH, you can check out the following guides:
Do you find any problem with SSH? Feel free to leave comment and share your experience.
WARNING: It’s highly recommended you follow this guide to secure your jailbroken iPhone (with SSH enabled) from virus attack!
Share with Your FriendsWhat's Next?
If you find the post is useful, subscribe to Simon Blog using RSS or Email to get free iPhone updates. Alternatively, you can follow me on Twitter or join us on Facebook.
Related Post you'll like:- Transfer Photos from iPhone wirelessly using SSH
- Transfer Ringtone to iPhone wirelessly with SSH
- Netatalk lets you transfer files between iPhone and your Mac wirelessly
- How to Enable EDGE/APN Editing on Jailbroken iPhone
- DiskAid: Transfer Files between iPhone & Computer via USB






{ 8 trackbacks }
{ 62 comments… read them below or add one }
hi…… and how do you change permissions for the files??? (ex. 777etc..)
@Javier Gil
Yo! Right click on the file, scroll down to properties/CHMOD. Once clicked, a new window will open up and u will see permissions [xxxx] Change the permissions to correct number and hit apply or ok.
Good job on the How To Simon!
Hey Simon, thanks for the great how-to. However, I think it’s still too difficult for most ppl. I tried SSh my iphone once when I first jailbreak it but I got tired of the tedious process.
There’s a simple solution to this. I dont know if you ever heard of “iphonebrowser.” It’s a great opensource app that lets you access your iphone sans all the setups that are required for SSH.
Pros:
Plug, Run and Play. No more preliminary steps.
Fast transfer speed (over USB cable)
Easy for everyone, no need to write a guide for it.
Preset Directories: Wallpapers, Pictures, DCIM photo, UI Sounds, Ringtones, Theme folder etc.
Cons:
No wireless transfer (must use USB cable)
changing permission? (I never change permission so I dont know if it’s there or not)
Let me know if you find Iphonebrowser worthy.
I forgot one best Pro:
you get to access/transfer files in the background even when the phone is locked. How cool is that.
Hi Simon,
After upgrade, jail break and unlock i am not able to install openSSH, installer, video recorder is installed but not able to open it and not able to load lots of applications which was there already.
As well as could you please reply me i am getting lots of error messages while installing any kind of application.
Regards
Sam
Me too. Just like sam. I’m getting error messages for almost anything I try to dl and install form cydia. Even some essential updates it says I should dl or else I’m going to have problems. Particularly for SSH it gives me a “couldn’t configure pre-depend dpkg for ncurses, probably a dependency cycle” error. Any help or ideas? Thanks…
Hi Simon,
Everything went fine until….. I did the jailbreak and installed openSSH using Cydia and then installed Cyberduck on my Mac. Then went to open connection after retrieving the ip from the iphone and using root and alpine got connection failed. Not sure why. My mac is connected to a home network and the iphone uses that without any issues
i did exactly as you wrote but i end up with network connection time out?
any ideas on how to fix this?
@Nicole, looks like your iPhone is not enabled with SSH. If you’re sure you have installed OpenSSH, try to restart your iPhone and try again.
“You may be curious why you can use SSH on iPhone. Is SSH just designed for Unix?”
Many LOLS…
SSH is a protocol. It has NOTHING to do with UNIX/LINUX. It is the secure replacement for Telnet. Like any protocol it is used for communication and is not OS specific, even though most bare bones Linux kernels support it. I realize you’re trying to dumb this down for the average Mac users (read people who can’t use a toaster sans epic fail unless Steve Job’s puts an i in front of it).
While I have an iPhone, the first thing I did was jailbreak it. One thing I couldn’t stand about Apple in the 1980’s and now is their insane level of control over everything you can do on your Mac/iPhone/iPod. It’s ridiculous, and they’ll never change. They’re like the “Pied Piper” stringing people along with promises of a better experience as long as you assimilate to their domination which is why the Linux/Windows market will always prevail. Linux may be a bit behind the curve in friendliness, and Windows has struggled, but both are catching up to Macs, especially Windows with the WPF initiative.
Hi .need help .have a 3gs. Have one pc with xp professionel where my iphone can wifi connect with winscp and openssh and ex internet explorer and discover app but a vista and xp home edition where nothing works but my old first generation works with all pc. What are my two computers missing to be able to communicate with my 3gs?
@Claus, to use SSH for file transfer, you need to jailbreak your iPhone 3GS first. So, are you using jailbroken iPhone? If yes, you can install OpenSSH via cydia and then transfer file via SSH.
Hi simon. Thank you for answering. I know that and is jailbroken like my first generation iphonw. But the new 3gs do not reply always maybe one in 100 atemts. Grt timeout. Also with cable and tunnel program. Also no reply when use free ftp apps like discover and try to contact with filezille or IE. Like my phone wont answer. If i am lucky an get connection the wifi is extremly slow or the connection stops short after with time out . Turned off autolock and installed keep wake no improvement. There is no iphone support here in denmark and have had it to repair but they said nothing wrong. I do not know what to do. Can use wifi and can easily downloadand stream also from my own media server. Itseems that it is only when my iphone my reply there is problem and suddently it works but very very slow few kb pr sec. But iphone browser i found on internet works perfect with cable on all my pc but i dont think the phone need reply with this. Sorry i am a noob and not good with this why it might sound strange when i tri to explain. Claus
@Claus, did you try to reset the network setting? You may check out this post and see if it can resolve your wifi issue.
hi what do i download on to my i phone once i have jaol broke it so i can get free apps on it.
Google.com
That is way off topic for how to SSH and I don’t believe Simon would prefer that to be discussed here.
Use the App Store and support devs to get your downloads for apps and games!!!!!!!!
O ya, its also called Jailbreak, Jailbreaking or Jailbroke iPhone for helping u on ur searches
Nobody thathas experiances what i wrote two days ago? 3gs with 3.01. anyone know a website that might help with issues where things just not work? I need more than a recipe for how it should work. Need some expert advice andno one here in denmark. Just blogs which again shows how it should work no experts when there are problems. Hope for some assistance.
plz try iphone haking site or redmondpie site to get solution
Have reset and restored Multple times and downgraded to 3.0. No change at all.
hi. i used this tutorial to transfer a .pdf into my iphone. everything went fine. but when i went to open this file via fileviewer, which i got from cydia, i get this:
error:
operation could not be completed.
(webkiterrordomain error 101.)
anybody know how i can open and view this .pdf on my iphone?
thanks.
@Chris, you can download “File Share” or “Good Reader” from App Store. Both applications can let you read PDF on iPhone.
oh yeah…it’s a 2g with 3.0 firmware.
thanks a bunch simon ng. much appreciated.
А если посмотреть на это с другой точки зрения то не все так гладко получается
Have a jailbroken iphone 2g 2.1 .. i don’t seem to be able to connect thru ssh using winscp or putty.. it tells me “software cause connection to abort” .. Have tried using wifi and via USB as well .. further am using itunes 9 ..
I have installed openSSH on the iphone 2g and ssh is active on it.. further I have the IP of the phone correctly
PLS HELP ..maninder
hi !!! i have a mac… how do i change the permissions ?
Please, please, please append the post to warn people that they should change their passwords for both accounts (root and mobile) after installing SSH. Again (not for the first time) someone has broken into a range of iPhones over the 3G network, using the default password: see http://arstechnica.com/apple/news/2009/11/dutch-hacker-holds-jailbroken-iphones-hostage-for-5.ars
Unfortunately, most SSH tutorials fail to mention this. Yours is one of the first to turn up in a Google search for ‘SSH iPhone’, so it’s important that you warn your readers.
@Jim, thanks for your suggestion. Now it’s advised to follow this guide to secure the jailbroken iPhone once SSH is enabled.
Speaking of changing the SSH password, in Cydia, there is a nice step by step tutorial. Go to the main menu, scroll down, go to “OpenSSH Access How-To”.
Follow the steps if you haven’t already installed SSH. If you have, then scroll down, and there’s another arrow taking you to “Change default password.” And follow those instructions.
Alternatively, install OpenSSH.
Get your iPhone’s ip address
Open Terminal
Login to your iPhone using “ssh root@
Accept the host key if you are asked
login with password “alpine”
type “passwd”
you will be asked for a new password, but the cursor won’t respond as you type in, so be careful.
you will be asked to repeat the password. again, be careful
all done
@Doug, thanks for the great tips!
Another Thanks for the know-how show-how! This is great and again your directions are right on!! Thanks again!!
jim frogge in NC!
Heyy thanks for the tutorial but i jsut have a problem
i have a jail broken iphone 3gs with a wifi connection at home
and i have tried doing the sssh root@(ip-address) thing on “Terminal” on the iphone and it will connect like that but when i do it with WinSCP on my windows Vista Computer it always says that the connect was time-out and i have installed openssh because i can see in both icy and cydia that the program is installed but when i robooted my iphone no ssh program or anything opened up so im very confused
any help please?
Thanks alot in advance
Best Regards Sina
wow.. that was easy then expeced… thanks
I can use openssh to do file transfer. But it works only for a while, say for a few minutes. Than the server unexpectedly terminates the connection. Thus I have to reinstal openssh every time to get the connection. Have already changed the password. Is there a way out. Please help.
Keep the phone ‘awake’ (don’t let it lock). But anyway, this can happen; I get it too. You don’t need to reinstall OpenSSH. If you install any of the programs that can close and restart OpenSSH, that will be enough. For example, SBSettings has a toggle for SSH. It can quickly turn SSH off and back on, so the connection can be established again.
Alternatively, turning the phone off and on again will work. You can also try a solution using the USB cable (iTunnel, iPhone Tunnel Suite) though I’m not sure whether there is currently a working version.
Thanks Jim. I tried all these. Kept the auto lock on “never”. Used BossPref to turn openssh on and off. Also putting the phone off and on. However, it works only on reinstall and that too for 3 to 5 minutes. Will try itunnel now. But would be grateful for any solution with wifi.
Sharma, I suggest you create an account at the hackint0sh.org forum and see if you can find a thread there about this problem. I’m almost sure they exist and you can add a post to one of them asking for help. It is a forum where the most knowledgable technical jailbreak-people are posting.
i have a mac and i cannot open cyberduck…..when i double click it it appears in the dock and it bounces…and then dissapears…can anyone help me please?
Hi Guys
I have successfully copied the files over…now how do i run them (apps) It would appear the only app to extract apps installed this way is called “installulouss”…but as far as i can see you can no longer download it. I have no way of accessing the files i have copied over?
Thanks
Ross
watsup guys im on windows xp and when ever i try to ssh ill add all my information into winscp and when i click login a white screen just pops up ive re downloaded and re jailbroken my iphone 3gs and nothing seems to work. please help i miss being able to ssh and get into my iphone :[ thanks
Hi Guys,
I’m new to this, jailbroke my 3GS 3.1.2 using blackra1n. Worked fine. I failed to install openssh when my Cydia was working. Last night my Cydia opens breifly, says loading data, and closes. I can’t get into Cydia. Can’t install openssh without Cydia, Do I need to restore my phone, or is there a way to install openssh without Cydia or re-install Cydia without SShing?
Any help would be appreciated!
Thanks
Dave
You can download the installation package for OpenSSH directly from http://apt.saurik.com/dists/tangelo/main/binary-iphoneos-arm/debs/openssh_5.2p1-8_iphoneos-arm.deb
You also need OpenSSL: http://apt.saurik.com/dists/tangelo/main/binary-iphoneos-arm/debs/openssl_0.9.8k-9_iphoneos-arm.deb
and then use this method to install both packages: http://www.hackint0sh.org/f128/63529-2.htm#post385516
If your iPhone is jailbroken, and you are running Mac OSX, you can also install “Netatalk” along with “OpenSSH” from Cydia. With Netatalk installed as well, your iPhone will show up as a device in the finder, making this process even easier, because you will not need any additional software.
Apple Products work perfectly… together
My Cyberduck also bounces once then closes, but only if I open it from my Applications folder. If I move the Cyberduck file into, say, my downloads folder, it opens fine…
hi, i installed openshh on my iphone. and downloaded WINscp. but when i try to login in it just keeps asking for my password and saying access denied. but i have the right password..
Just a note for anyone trying to transfer photos via SCP, and is wondering how to generate the .THM thumbnail files so you don’t have a page of black in the photo album (it took me ages to work this out!)
The .THM files go in a folder entitled .MISC, which resides in the same directory as the photos. If you’re using linux and have Image Magick, a simple shell command to make the .THM files is:
for i in *.JPG; do convert $i -resize 240 -crop 160×160+40+0 .MISC/`basename $i .JPG`.THM; done
Hope this helps someone …
I’ve got the window vista, netframe 3.5, itune 9. My iphone firmware’s 3.1.2. When i try to putty to my phone and got the message: connection refused. Then, I tried this command on mobile terminal ssh root@127.0.0.1 then got the message: connection closed by remote host. Do you think iphone itself lock the connection to host? any help much be appreciated. Viet
127.0.0.1 is not the right address. See the details of your wifi connection (in Settings… Wi-Fi…) for the right address.
You mean with mobile terminal, I can only ssh to iphone with wifi setting? Normally, i connect iphone to computer by usb cable and thought 127.0.0.1 is default address. I will try with wifi to see the difference. thanks
I’ve tested with wifi. It’s also the same result “connection close by remote host. Any help
If you ssh into your phone through the USB cable, you need to have iTunnel running on your computer. Why you’d use MobileTerminal on your phone to make an ssh connection to itself I don’t understand. You’re already logged into the phone once you have started MobileTerminal on the phone…
Dear Jim,
It might be silly when i tried to connect to itself. Because I just want to test openssh work or not on iphone. Could you tell me why i need itunnel running on my computer? which version of itunnel should i install now?
iTunnel allows your computer to ’see’ the phone through the USB cable as if it’s a device on the local network, at address 127.0.0.1 on port 22 (or any other port you specify when launching iTunnel). Once that is achieved, PuTTY can make an ssh connection to that address.
I think iTunnel is now at version 9. You may also need to copy a .dll file from one of iTunes’ program directories, and you probably need a recent version of iTunes with which you have already connected the phone. Google will provide more instructions.
That said, if your computer and your iPhone are on the same local network (e.g. the computer is 192.168.100.2 and the phone 192.168.100.3), PuTTY should normally be able to connect to root@192.168.100.3 on port 22. If not, maybe your router doesn’t allow connections between its clients. That can usually be changed in the router’s settings.
i am also having the issue where its telling me that i dont have the correct password any help would be greatly appreciated for me and the other poster above me thanks
if you don’t change the password, just login by root, password is alpine. It’s default setting.
thanks for the quick reply bro
dude i try to download open ssh but cant … it says “Http://apt.saurik.com host unreachable.” and also can u tell me how can i disable APN without doing SSH or any thing complicated . something simple would be great!
I coudnt get the password to work
Tried to set up an SSH connection, but ran into a problem:
I/O Error: Connection failed
sftp://192.168.1.11
There was a problem while connecting to 192.168.1.11:22
Any Help?
Thanks.
worked for me tnx
Nice work simon!!!
Muchos Gracias