TUTORIAL: SSH via USB

Discussion in 'iPod touch' started by pss, Apr 28, 2009.

  1. pss

    pss New Member

    Joined:
    May 24, 2008
    Messages:
    204
    Likes Received:
    0
    Device:
    3G iPod touch
    It is possible to connect your iPhone or iPod Touch to your computer using SSH and use SSH through the USB connection. This connection is much faster and more reliable than SSH via Wi-Fi, and is also handy if you need to SSH into your device on a laptop while away or if there's no Wi-Fi AP availible nearby.

    In this tutorial I use a command-line utility called "iphone_tunnel.exe" There is also a GUI alternative called "iPhone Tunnel Suite", but I've noticed it act quite dodgey, especially when the website goes down as it "phones home" for a new version whenever you run it. This is essentially the executable iPhone Tunnel Suite uses, but without the GUI iPhone Tunnel Suite provides.

    1. Obtain http://oss.coresecurity.com/repo/iphone_tunnel-v1.01.zip from the internet and unzip it to a folder (let's say "C:\itunnel")
    2. Obtain "iTunesMobileDevice.dll" either from the internet or your iTunes folder at "C:\Program Files\Common Files\Apple\Mobile Device Support\bin". The latter method is preferred as I cannot link to this file, and the one you already have is the proper version to use (no mismatches). Copy it over to the same folder as iphone_tunnel.exe DO NOT "MOVE" IT FROM THE "bin" FOLDER, "COPY" IT.
    3. Click start-run then type in "cmd"
    4. Type these commands into the window:
    cd\itunnel (or wherever you put the two aformentioned files)
    iphone_tunnel.exe 22 22

    After this, you have a command-prompt window open conducting a re-routing process that sends any call to 127.0.0.1 to your USB-connected handheld. From this point, you can substituite "127.0.0.1" for the Wi-Fi IP you normally connect to the device with. For example, in WinSCP, to connect to the device via USB, ensure the command-prompt application is running and enter in 127.0.0.1 as the hostname to connect to. ("root" and "alpine" remain the same as if it were over Wi-Fi.)

    To close the tunneling app, simply click the "X" on the Command Prompt window, or hit CTRL+C while it's in focus. This gives "127.0.0.1" back to your computer, what it originally was before the tunneling. There is a more sophisticated way that opens the tunnel, opens PuTTY or WinSCP, then after you close them, closes the tunnel; all without a command-prompt window. It's essentially a more polished process that leaves the technical stuff in the background. I can elaborate on this if requested.
  2. jhloa2

    jhloa2 Member

    Joined:
    Feb 11, 2008
    Messages:
    714
    Likes Received:
    3
    Device:
    iPhone 4 (Black)
    or you can download DiskAid (google it) and you don't need to set anything up (works for mac or pc)
  3. pss

    pss New Member

    Joined:
    May 24, 2008
    Messages:
    204
    Likes Received:
    0
    Device:
    3G iPod touch
    WinSCP is faster and more versatile than DiskAid. DiskAid is mainly for copying over stuff: WinSCP can edit text files as well. This technique also is good if you want to use PuTTY over USB.
  4. Germany

    Germany Banned

    Joined:
    Oct 9, 2008
    Messages:
    1,929
    Likes Received:
    0
    I heard DiskAid runs pretty slow (as I would expect) with no internet connection. WinSCP is much faster and like pss said, more versatile. WinSCP is a much better program and in my mind, is essential to all customizing.
  5. iolsmit

    iolsmit New Member

    Joined:
    Apr 23, 2009
    Messages:
    13
    Likes Received:
    0
    Device:
    2G iPod touch

Share This Page