iphone-hacks.com

#1 Spot for iPhone Hacks


You are not logged in.

Announcement

New to iPhone-hacks? Please, Read the RULES before posting!
  • Index
  •  » Tutorials
  •  » Howto SSH to the iPhone (using Dropbear SSH2)

#1  2007-07-23 13:33:51

greg
Ninja
From: Toronto, ON
Registered: 2007-07-10
Posts: 23
Website

Howto SSH to the iPhone (using Dropbear SSH2)

Requirements:

- jailbreak (Windows | Mac)

- iPhoneInterface (Windows | Mac)

- iPhone-SSH kit

- iPhone binaries kit

- Technical know-how & patience

NerveGas wrote:

Step 1: Key Creation

On your Mac or PC, download dropbear from here:

   http://matt.ucc.asn.au/dropbear/dropbear.html

Run: ./configure && make

You don't need to install the software, just run:

   ./dropbearkey -t rsa dropbear_rsa_host_key
   ./dropbearkey -t dss dropbear_dss_host_key

And copy the two new key files into your iPhoneInterface directory.

Step 2: Uploading dropbear and friends

   Download the iphone-ssh kit and the iphone binaries kit. If you don't
   know the URLs, you can get them from #iphone on irc.osx86.hu. Rename sh6
   from the kit to sh.

   Use the jailbreak application to break out of jail, and then open
   iPhoneInterface to connect.

   mkdir /etc/dropbear
   cd /etc/dropbear
   putfile dropbear_rsa_host_key
   putfile dropbear_dss_host_key
   cd /bin
   putfile chmod
   putfile sh
   cd /usr/bin
   putfile dropbear

Step 3: Overwriting 'update' with 'chmod'

   While still connected to iPhoneInterface, make a backup copy of
   /usr/sbin/update:

   cd /usr/sbin
   getfile update

   Rename this to update.original on your local filesystem

   Now copy the 'chmod' binary to 'update' and upload it back to the
   iPhone:

   cd /usr/sbin
   putfile update

Step 4: Overwriting the update configuration

   Now the 'update' binary is really 'chmod', and has execute permissions! We
   just need to tell the iPhone to chmod next time it boots. To do this, we
   download /System/Library/LaunchDaemons/com.apple.update.plist and add our
   own arguments to ProgramArguments:

   0 /usr/sbin/update
   1 555
   2 /bin/chmod
   3 /bin/sh
   4 /usr/bin/dropbear

   Save the new plist and upload it back to the iPhone:

   cd /System/Library/LaunchDaemons
   putfile com.apple.update.plist

   While we're here, lets also:

   putfile au.asn.ucc.matt.dropbear.plist

Step 5: Reboot the iPhone twice.

   The first reboot should set the permissions on the dropbear and related
   binaries. The second reboot should start dropbear, so you can ssh to it:

   ssh -l root [IP ADDRESS]
   The root password is 'dottie'.


Step 6: Replace the original update and com.apple.update.plist files

   Don't forget to put the old update files back. Rename update.original back
   to update, and delete the extra ProgramArguments you added to
   com.apple.update.plist. Now put them back:

   cd /System/Library/LaunchDaemons
   putfile com.apple.update.plist

   cd /usr/sbin
   putfile update

- source: http://iphone.fiveforty.net/wiki/index.php/Dropbear-ssh

Offline

 
  • Index
  •  » Tutorials
  •  » Howto SSH to the iPhone (using Dropbear SSH2)

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB