Login - Contact Us

Guide - SSH to your Iphone via USB

Wednesday, August 20, 2008 discuss in our forum | read comments(59)  
Radio Control Toys
Since i've been doing some work on my phone at work i have not been able to SSH into it. Wifi is against company policy, so i had to think of something. After some research on the net i came accross a utitliy called iphone_tunnel. This application basically maps over a port to your local pc. So since SSH is running on port 22 it will map it over to your local pc and then you SSH into your local ip 127.0.0.1.

Note your phone needs to be jailbroken and have SSH running otherwise you cant SSH to your phone.

Let me explain a with more detail.



Step 1.

First go and grab the files neccesary here.



Step 2.

Go ahead and extract the content of the rar file.



Step 3

Start a dos command window and browse over to the directory where you extracted your rar file. In my case this is at c:\iphone then run this command "iphone_tunnel.exe 22 22" without the quotes. This will start the tunneling service.



Step 4.

Launch your client, we're usingn WinSCP found in out files section. In the host name enter ip 127.0.0.1 then click login and wait.



Step 5.

When it prompts you for the user name put in "root"



When it prompts you for password enter "alpine"



You should now be able to browse your iphone content.



If this guide helped you, please take the minute to digg our store with the link on the right.

Labels: ,




59 Comments :

     
   Anonymous Anonymous - 

I get this error, please help!

new connection !
AMDeviceNotificationSubscribe = 0
iPhone attached !
AMDeviceConnect = 0
AMDeviceIsPaired = 1
AMDeviceValidatePairing = 0
AMDeviceStartSession = 0
MobileDevice: AMDeviceStartService: AMDeviceStartService: Could not connect to U
SB mux (error 10061)
AMDeviceStartService = -402653131
AFCConnectionOpen = 0 
 
     
     
   Blogger iphone3g-mods - 

which itunes version are you running? 
 
     
     
   Anonymous Anonymous - 

I got the same error as above, Im using Itunes version 8. 
 
     
     
   Blogger iphone3g-mods - 

which os? 
 
     
     
   Anonymous Anonymous - 

i get similar error

new connection!
MobileDevice:AMDeviceNotificationSubscribe:USBMuxListenerCreate: No error
AMDeviceNotificationSubscribe = -402653131
callback error!

vista32
.net 3.5
iT 8
iP2G 2.1 
 
     
     
   Blogger freeze - 

im stuck at step 3.im a newbie with this ms dos thing. everyitme i run the command window,this will appear

C:\Users\user>_

how do i set this to be only:

C:\ 
 
     
     
   Anonymous Anonymous - 

To get from C:\users\user, just type in cd.. and it will bring you up a level. So in this case it would bring you up to Users. Then do it again to get to C:\ 
 
     
     
   Anonymous Anonymous - 

And this isn't working for some reason. When i type in "iphone_tunnel 22 22" the cursor moves to the next line and does nothing. I am using iPod Touch with iTunes 8.0.1.11 and I am running Vista. 
 
     
     
   Anonymous Anonymous - 

i got the same thing cursor moves and nothing happens! help plzzz 
 
     
     
   Anonymous Anonymous - 

Wow, it didn't work on one of my school computers but it did on another! Cool!!! 
 
     
     
   Anonymous Anonymous - 

Thank you so much!!!!!!! 
 
     
     
   Anonymous Anonymous - 

this comment is really late, but for the guys who posted december 4 and 28, after it does nothing, login in to winscp. then it should do its thing. 
 
     
     
   Anonymous Anonymous - 

thanks a million i was getting block by this hotel wifi thanks again :) 
 
     
     
   Anonymous Anonymous - 

This was excellent! Worked like a charm! Thanks a bunch! thought I am a bit of a moron, i couldn't find the Digg thing you were talking about... 
 
     
     
   Blogger Leo - 

THIS FUCKING SUCKS! YOU GUYS DPNT GELP AT ALL ONLY SAY INSTALL OPEN RUN BKAH BLAH NO DETAILS NOTHING THIS SHIT ITS USELESS MORE DETAILS!!!!!! 
 
     
     
   Blogger iphone3g-mods - 

if you need more help please join our forum and we can help you from there, funny your the only one not getting it 
 
     
     
   Anonymous Anonymous - 

Thankyou so much!!! brilliant piece of code. :) 
 
     
     
   Anonymous Anonymous - 

new connection !
MobileDevice: AMDeviceNotificationSubscribe: USBMuxListenerCreate: No error
AMDeviceNotificationSubscribe = -402653131
callback error !

was there ever a solution for this? 
 
     
     
   Anonymous Anonymous - 

what when software stops it? 
 
     
     
   Anonymous Vladimir - 

Doesn't work: WinSCP shows "Network error: Software caused connection to abort" dialog.

The cmd window displays the following:

new connection !
AMDeviceNotificationSubscribe = 0
iPhone attached !
AMDeviceConnect = 0
AMDeviceIsPaired = 0
MobileDevice: AMDeviceValidatePairing: Could not load pairing record C:\Document
s and Settings\vniyazov\Application Data\Apple Computer\Lockdown\b7df396e92c89ed
6bae78b49b053ac2378e6da49.plist
AMDeviceValidatePairing = -402653147
AMDeviceStartSession = -402653147
AMDeviceStartService = -402653154
AFCConnectionOpen = 0 
 
     
     
   Anonymous Anonymous - 

I get the same error as Vladimir...is there a resolution to it? 
 
     
     
   Anonymous Anonymous - 

Vladimir -

Doesn't work: WinSCP shows "Network error: Software caused connection to abort" dialog.

The cmd window displays the following:

new connection !
AMDeviceNotificationSubscribe = 0
iPhone attached !
AMDeviceConnect = 0
AMDeviceIsPaired = 0
MobileDevice: AMDeviceValidatePairing: Could not load pairing record C:\Document
s and Settings\vniyazov\Application Data\Apple Computer\Lockdown\b7df396e92c89ed
6bae78b49b053ac2378e6da49.plist
AMDeviceValidatePairing = -402653147
AMDeviceStartSession = -402653147
AMDeviceStartService = -402653154
AFCConnectionOpen = 0
-----------------------------------------------------------------------------
Solution of the problem
C:\Documents and Settings\All Users\Application Data\Apple\Lockdown Folder Copy
C:\Documents and Settings\vniyazov\Application Data\Apple Computer\ Paste 
 
     
     
   Anonymous Anonymous - 

I just wanna say thank you for this wonderful solution for the "Network error: Software caused connection to abort".

Just to clarify for other people, i am using ITS2.7, winxp, itunes 8.2 and facing this problem. After searching for whole day, finally get this solution work.

To make it clear,
copy the "Lockdown Folder" from C:\Documents and Settings\All Users\Application Data\Apple\ and paste into C:\Documents and Settings\username\Application Data\Apple Computer\ . It will function. thx again.


Solution of the problem
C:\Documents and Settings\All Users\Application Data\Apple\Lockdown Folder Copy
C:\Documents and Settings\vniyazov\Application Data\Apple Computer\ Paste 
 
     
     
   Anonymous Anonymous - 

I am getting the same problems & have moved files but still wont work.

new connection !
AMDeviceNotificationSubscribe = 0
iPhone attached !
AMDeviceConnect = 0
AMDeviceIsPaired = 0
MobileDevice: AMDeviceValidatePairing: Could not load pairing record C:\Document
s and Settings\vniyazov\Application Data\Apple Computer\Lockdown\c4dbbfffcac6118e4806556a4980b186aa9cb35b.plist
AMDeviceValidatePairing = -402653147
AMDeviceStartSession = -402653147
AMDeviceStartService = -402653154
AFCConnectionOpen = 0

I don't have this file c4dbbfffcac6118e4806556a4980b186aa9cb35b.plist in my Lockdown. Where can i get it from i have only got the following:

b3d921b4a504f3d09c290237b52ef04c4c64c04e.plist
f694b580ae70e2ab13a529cfad75d848f9a90a03.plist

Any suggestions would be great.

Thank you 
 
     
     
   Anonymous Anonymous - 

My messgae is the one above using:

Vista
iTunes latest version
WinSCP latest version

Hope you can help 
 
     
     
   Anonymous Anonymous - 

Same prob. as above after updating to 3.0 
 
     
     
   Anonymous b00 - 

try to open itunes with your iphone connected , so the itunes create the .plist file....I am not sure, just try it. 
 
     
     
   Anonymous Anonymous - 

Vista
iTunes latest version
WinSCP latest version

Same as lots of others...and stuck!!
Even tried opening itunes but still the same
Doesn't work: WinSCP shows "Network error: Software caused connection to abort" dialog.

The cmd window displays the following:

new connection !
AMDeviceNotificationSubscribe = 0
iPhone attached !
AMDeviceConnect = 0
AMDeviceIsPaired = 0
MobileDevice: AMDeviceValidatePairing: Could not load pairing record C:\Document
s and Settings\vniyazov\Application Data\Apple Computer\Lockdown\b7df396e92c89ed
6bae78b49b053ac2378e6da49.plist
AMDeviceValidatePairing = -402653147
AMDeviceStartSession = -402653147
AMDeviceStartService = -402653154
AFCConnectionOpen = 0


Someone's gotta know how to sort this...please 
 
     
     
   Anonymous Anonymous - 

@above: iPhonebrowser... sorted. 
 
     
     
   Anonymous Anonymous - 

I was getting the same error above and I just simpley copied the Lockdown folder from C:\Users\All Users\Apple to C:\Users\pprice\AppData\Roaming\Apple Computer, I also copied the .plist file to and works fine now. 
 
     
     
   Anonymous Anonymous - 

Just copy your file "iTunesMobileDevice.dll" into "C:\Program Files\iPhone Tunnel Suite\iTunnel".
My iphone is 3.0 and it works perfectly. 
 
     
     
   Blogger 재영 - 

This comment has been removed by the author. 
 
     
     
   Anonymous Fyfthelement - 

THANKS!! WORKS GREAT!!! COPIED FOLDER FROM "ALL USERS" PROFILE TO "MY USER PROFILE" THANKS!!! 
 
     
     
   Anonymous Anonymous - 

as one user stated above, copy whatever version of "iTunesMobileDevice.dll" you have installed on your computer to the iphone tunnel folder and you should be good to go. it got read of the errors I was having 
 
     
     
   Anonymous Anonymous - 

Copy and paste of lockdown folder from All Users\Apple to *my-user-name*\Apple Computer (see above) works like a charm. Thanks! 
 
     
     
   Anonymous Anonymous - 

hellloo!!!
it's working fine !!
i did it !!
thank you !!
this is a better method than the one with cute ftp
have a nice day !!! 
 
     
     
   Anonymous Anonymous - 

Here's the fix for 'Could not load pairing record' error:
http://www.ipodtouchfans.com/forums/showthread.php?t=206096

Just tried it and it works :) 
 
     
     
   Anonymous Anonymous - 

I have found a much much much easier solution...it seems that whoever bundled these files took an older version of iTunesMobileDevice.dll, simply go to "C:\Program Files\Common - Files\Apple\Mobile Device Support\bin" and copy iTunesMobileDevice.dll and copy it to wherever you have iphone_tunnel.exe, let it overwrite the file that is already there and poof! problem solved 
 
     
     
   Blogger iphone3g-mods - 

the reason for that is because if you update your itunes, or a new version comes out you have to update that file, this guide was written pre version 8 so the file included is outdated, move the new version of what ever itunes version you are running into that folder and voila your tethering will work again :)

thanks for pointing that out 
 
     
     
   Blogger Mike Crandall - 

Getting this error in iTunes 9.0.1:
new connection !
AMDeviceNotificationSubscribe = 0
iPhone attached !
AMDeviceConnect = 0
AMDeviceIsPaired = 1
AMDeviceValidatePairing = 0
AMDeviceStartSession = 0
MobileDevice: _send_message: Could not encode message as XML
AMDeviceStartService = 0
AFCConnectionOpen = 0 
 
     
     
   Anonymous X - 

Here is a workaround fix for the XML error code. ( This only works if tunes 8.0 was previously installed to the PC OR you have the install cache from a pc with itunes 8.0

Open windows application remove/update and remove "Apple Mobile Device Support".
Navigate to:
"C:\Documents and Settings\All Users\Application Data\Apple\Installer Cache\Apple Mobile Device Support 2.5.2.2"
and install the MSI.
You can leave the 9.0 dll from this tutorial in the folder with itunnel.
Start itunnel and enjoy :) 
 
     
     
   Anonymous X - 

Whoops, Slight Correction,

After isntalling the MSI, copy
"C:\Program Files\Common Files\Apple\Mobile Device Support\bin\iTunesMobileDevice.dll"
to the same folder as your itunnel.exe file 
 
     
     
   Anonymous Anonymous - 

Ummm gus can u please help me when I download Iphone tunnel my anti virus system says it's a virus is this true plus i am using Norton 360 
 
     
     
   Blogger Admin - 

Nice tutorial, see this tutorial too, all working solutions are required stuff is added too.
http://developerinstincts.blogspot.com/2009/12/ssh-to-iphone-via-usb.html

I tried it myself and it is working. My problems were solved by using other version of iTunnel.

Thanks. 
 
     
     
   Anonymous Anonymous - 

To fix the "Could not encode message as XML" error, you must upgrade iTunnel: http://27.am/posts/52/restoring-iphone-usb-access-under-itunes-9 
 
     
     
   Blogger TMR - 

iSutal V9.10.09 Released- iSutal
i-FunBox | File Manager, Browser, Explorer, Transfer Tool for iPhone, iPad & iPod Touch via USB

if you want to copy your files and winSCP doesnt work with this works fine.
Firmware 3.1.2
iPhone 3G 8GB 
 
     
     
   Blogger iphone3g-mods - 

now a days just install 2 things

air share HD + ifile

airshare will let you dump files on your device and ifile will let you move it copy it or extract it anywhere on your phone its a file browser for the iphone ipad 
 
     
     
   Anonymous Anonymous - 

the updated iTunnel file that anonymous posted worked. thanks. 
 
     
     
   Anonymous Anonymous - 

which itunnel file ? mine still not working for me here ..
tried to copy and paste the mentioned folder above..
i still got the error: software caused connection abort.

any solution ? 
 
     
     
   Anonymous Anonymous - 

just got it working with a recently jailbroken 3gs on os 4.0. yay!
thanks!
i used the itunnel provided here:
http://27.am/posts/52/restoring-iphone-usb-access-under-itunes-9
i'm on windows 7 so i had to set compatiblity of the exe file (and the cmd file) to xp sp3. 
 
     
     
   Anonymous Anonymous - 

i also have to copy the folder. on windows 7 it is a little bit different. the lockdown folder has to be copied to
C:\Users\username\AppData\Roaming\Apple Computer\Lockdown

i'm using the newest version of itunes 
 
     
     
   Anonymous Anonymous - 

X is lying!
dont trust him.
it will make your itunes not working anymore.
once you remove the mobile device support, you wont find the msi, its pointless. 
 
     
     
   Anonymous Anonymous - 

Yah you r right with x's solution I have to reinstall all the iTunes and all. I am getting encode XML error. Is there anyone who knows the fix.
I am on Windows 7, iTouch iOS 4.1, iTunes 10 
 
     
     
   Anonymous Roach - 

I went round and round the houses with this, tried many tunnel tools and had many connection refused errors, plus later Could not encode XMLAMDevice error too.

What fixed it was the iTunnel (9 version opening/mapping 22 22), with the .exe prioperties set in XP compatibility mode, and Runtunnel.cmd run as administrator. Truth be told I can't remember whether it was the iTunesMobileDevice.dll from the iTunnel zip file or from elsewhere my system that worked in the end. I'd also done the Lockdown folder copy. I also had to use Task Manager to make sure no tunnel tools or iTunes itself were already running, or else iTunnel would not launch.

iTunes 10, Win Vista 64, iPhone 3GS running 4.1 limerained 
 
     
     
   Anonymous Anonymous - 

make sure that "Apple Mobile Device" service is started as well. To check, you can run "services.msc" from Run prompt. 
 
     
     
   Anonymous lawlist - 

For those users with a Mac computer who are Googling and looking for a method to ssh via usb to a current generation firmware iOS device (e.g., an iPhone 4.1), it is not only possible, but fairly easy to accomplish — you need two files — place tcprelay.py and usbmux.py in the same directory on the Mac (with tcprelay.py being chmod-ed so that it is executable, like 755) — from the terminal window inside the directory containing the two aforementioned files, type: ./tcprelay.py -t 22:2222 &

For non-experts, you can then use a sftp client — the server is localhost, and the port is 2222. For ssh experts who use the terminal, you don’t need my help (I need yours). The files are here:

https://github.com/gilir/usbmuxd-deb...python-client/

[key words for Google-ers like me: ssh via usb iphone mac osx python terminal cydia openssh] 
 
     
     
   Blogger Ramappa - 

Hi Is this solution only for jailbroken iphone.

I've iphone 4 not jailbroken.
I'm getting below error. I replace the latest .dll file and also Lockdown folder.
I've itune 10 installed and itunnel9.
Any specific itunnel for itune 10 please?


new connection !
MobileDevice: AMDeviceNotificationSubscribe: USBMuxListenerCreate: No error
AMDeviceNotificationSubscribe = -402653085
callback error !

Regards,
Ram 
 
     
     
   Blogger snowfox - 

new connection !
MobileDevice: AMDeviceNotificationSubscribe: USBMuxListenerCreate: No error
AMDeviceNotificationSubscribe = -402653131
callback error !

os window 7 
 
     
     
   Anonymous Anonymous - 

I've seen that itunnel is now outdated and that you must use i-funbox instead. 
 
     


Post a Comment

Please leave a comment and no spam.