RSS

SSH into iPhone over USB without Wi-Fi

October 11

SSH into a Jailbroken iPhone allows to browse files & folders on the device easily. When the iPhone and the computer are connected to the same WiFi network, it is easy to do SSH using any SSH client. SSH into the iPhone is also possible over USB cable and this comes handy in cases when the iPhone is not connected to the network. Steps below explains the procedure to SSH into the iPhone over USB cable.

Steps to SSH into iPhone through USB Cable (windows):

1. Jailbreak the iPhone and install OpenSSH from Cydia.
2. Download Python 2.6 and install it to c:\python26 folder.
3. Download usbmuxd file and extract it to C drive using winrar.
4. Connect the iPhone to windows machine over USB cable.
5. Open command prompt and type the below commands.

C:\> cd usbmuxd-1.0.8
C:\usbmuxd-1.0.8>cd python-client
C:\usbmuxd-1.0.8\python-client>\Python26\python.exe tcprelay.py -t 22:2222

SSH into iPhone without Wi-Fi

6. Download putty and open it.
7. On putty, enter Host Name as 127.0.0.1 and Port as 2222. Select connection type as SSH and click Open.

SSH into iPhone with putty

8. Now you are connected to iPhone over SSH. Type the username as root and the password as alpine to log into the iPhone.

SSH into iPhone putty

Note: Usbmuxd is a python module. So it works in Mac OS and other platforms as well. But the only limitation is, we can open only one SSH connection at a time. 

 

Posted by on October 11, 2012 in iPhone

4 Comments

Tags: , , ,

4 responses to “SSH into iPhone over USB without Wi-Fi

  1. Tex-Twil

    October 12, 2012 at 4:18 pm

    Nice, works also on OSX and Linux.

     
  2. Trillian

    March 16, 2013 at 3:21 am

    Many thanks for this tutorial. Works fine under Win 7 (64-bit) with WinSCP & PuTTY

     
  3. Tom Jones

    August 13, 2014 at 2:35 pm

    Hi,

    I got “Server unexpectedly closed connection” in putty following the instructions, using iPhone 3G. This is python’s script output:

    Incoming connection to 2222
    Waiting for devices…
    Connecting to device
    —————————————-
    Exception happened during processing of request from (‘127.0.0.1′, 53203)
    Traceback (most recent call last):
    File “C:\python26\lib\SocketServer.py”, line 558, in process_request_thread
    self.finish_request(request, client_address)
    File “C:\python26\lib\SocketServer.py”, line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File “C:\python26\lib\SocketServer.py”, line 615, in __init__
    self.handle()
    File “tcprelay.py”, line 82, in handle
    dsock = mux.connect(dev, self.server.rport)
    File “C:\usbmuxd-1.0.8\python-client\usbmux.py”, line 235, in connect
    return connector.connect(device, port)
    File “C:\usbmuxd-1.0.8\python-client\usbmux.py”, line 206, in connect
    raise MuxError(“Connect failed: error %d”%ret)
    MuxError: Connect failed: error 3
    —————————————-

    I also shared the internet connection by USB, and using iPhone new address (172.20.10.1) then I get a “connection refused error”.

    Regards.

     

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>