Jailbreaking the iPad - in Ubuntu

Exclusive offer: get 50% off this eBook here
Hacking Vim 7.2

Hacking Vim 7.2 — Save 50%

Ready-to-use hacks with solutions for common situations encountered by users of the Vim editor

$23.99    $12.00
by Delan Azabani | July 2010 | Linux Servers Open Source

Every article you'll see about jailbreaking an iPhone or iPad generally revolves around a program in Windows or OS X. If you're a Linux user, you'll probably feel left out. By the end of this article by Delan Azabani, you will be able to jailbreak your iPad with ease, and without Windows or OS X.

(For more resources on Ubuntu, see here.)

What is jailbreaking?

Jailbreaking an iPhone or iPad allows you to run unsigned code by unlocking the root account on the device. Simply, this allows you to install any software you like - without the restriction of having to be in the main Apple app store. Remember, jailbreaking is not SIM unlocking. Jailbreaking voids the Apple-supplied warranty.

What does this mean for developers?

The mass availability of jailbreaking for these devices allows developers to write apps without having to shell out Apple's developer fees. Previously a one-off payment of $300 US, an "official" developer must now pay $100 US each year to keep the right to develop applications.

What jailbreaks are available?

Arguably the most advanced jailbreak available now is called Spirit. Though unlike a few others, which can now hack iOS 4.0, Spirit differs in a few key features. Not only is Spirit the first to be able to jailbreak the iPad, but this jailbreak also allows an "untethered" jailbreak - you won't have to plug it into a computer every boot to "keep" it jailbroken. Support for jailbreaking iOS 4.0 is coming soon for Spirit.

There are tutorials on jailbreaking using Spirit, like this one, but they generally skip over the fact that there's a Linux version, and only talk about Windows and/or OS X.

Jailbreaking the iPad

A very simple process, you can now jailbreak the iPad very quickly thanks to excellent device support and drivers in Ubuntu. Please note that from now on, you should only plug in the device to iTunes 9 before 9.2, or better still, just use Rhythmbox or gtkpod to manage your library.

  1. Install git if you haven't already got it:

    sudo apt-get install git

  2. Clone the Spirit repository:

    git clone http://github.com/posixninja/spirit-linux.git

  3. Install the dev package for libimobiledevice:

    sudo apt-get install libimobiledevice-dev

  4. Enter the Spirit directory and build the program:

    cd spirit-linux
    make

  5. I've noticed that though Ubuntu has excellent Apple device support, and you can mount these devices just fine, that the jailbreak program won't detect the device without iFuse. Install this first:

    sudo apt-get install ifuse

  6. Now for the fun! Plug in your iPad (you'll see it under the Places menu) and run the jailbreak:

    ./spirit

    You'll see output similar to this:

    INFO: Retriving device list
    INFO: Opening device
    INFO: Creating lockdownd client
    INFO: Starting AFC service
    INFO: Sending files via AFC.INFO: Found version iPad1,1_3.2
    INFO: Read igor/map.plist
    INFO: Sending "install"
    INFO: Sending "one.dylib"
    INFO: Sending "freeze.tar.xz"
    INFO: Sending "bg.jpg"
    INFO: Sending files complete
    INFO: Creating lockdownd client
    INFO: Starting MobileBackup service
    INFO: Beginning restore process
    INFO: Read resources/overrides.plist
    DEBUG: add_file
    DEBUG: Data size 922:
    DEBUG: add_file
    DEBUG: Data size 0:
    DEBUG: start_restore
    DEBUG: Sending file
    DEBUG: Sending file
    INFO: Completed restore
    INFO: Completed successfully

    The device will reboot, and if all went well, you'll see a new app called Cydia on the home screen. This is the app that allows you to install other apps.

  7. Open Cydia. Cydia will ask you to choose what kind of user you are. There's no harm in choosing Developer; you'll just see more information. Also, if you choose the bottom level (User) console packages like OpenSSH will be hidden from you. You'll also receive some updates; install them. Interestingly, Cydia uses the deb package format, just like Ubuntu:

  8. That's it! Wasn't that quick?
Hacking Vim 7.2 Ready-to-use hacks with solutions for common situations encountered by users of the Vim editor
Published: April 2010
eBook Price: $23.99
Book Price: $39.99
See more
Select your format and quantity:

(For more resources on Ubuntu, see here.)

Using the device's terminal (rooting the device)

Now that you've jailbroken the iPad, you can use the terminal on the iPad from your computer, as the superuser (root) account. You can install OpenSSH on the iPad, allowing remote access. This process turns the iPad into a powerful Unix system.

First up, install OpenSSH through Cydia. Select "OpenSSH Access How-To" on the Cydia main screen.

Select the OpenSSH link, and install the app.

Now, to find out the local IP address of your device. Go back to the home screen, and open Settings. If you're using wireless LAN, select Wi-Fi, then select the arrow next to the network.

On your computer, open a terminal and log in to the device:

ssh root@192.168.0.128

You may have to wait for up to a minute, or even two, for the iPad to generate host keys. Once you are prompted, type "yes" and hit enter:

delan@delan:~/Build/spirit-linux$ ssh root@192.168.0.128
The authenticity of host '192.168.0.128 (192.168.0.128)' can't be established.
RSA key fingerprint is 4f:1f:f0:70:b8:40:47:84:23:5f:f0:a2:b6:07:56:3e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.128' (RSA) to the list of known hosts.

Here's a crucial part of the setup. Some people claim that jailbreaking your device makes it less secure - but this is partly due to people not changing the root accont's password. The default password for root is "alpine":

root@192.168.0.128's password: alpine

You are now logged into the iPad as root, with a fully functional Unix shell. Be careful; slip up and you may destroy all of the iPad's data!

Make sure you change the root account's password as soon as possible after you've finished testing. To change the root account's password, just use the passwd command:

AzaPad:~ root# passwd
Changing password for root.
New password: password here
Retype new password: password here
AzaPad:~ root#

A note on syncing the iPad

Currently, Ubuntu has excellent support for connectivity with Apple mobile devices. Ubuntu has the ability to control the full music library on all iPods and iPhones. However, full iPad support is yet to be finalised. Currently, making changes to the library will throw an "Unsupported checksum type" error - at least in gtkpod. The reason for this is that libimobiledevice hasn't included the necessary hash code for the iPad library. I've filed this as a bug; and here's what sukimashita had to say:

Will the iPad (using OS 3.2) work with libimobiledevice?
Yes it will. We tested access and all tools work as expected. Changes are in GIT and support arrives in the next releases.

Will iPhone OS 4.0 be supported by libimobiledevice?
Access and tools should work fine. However, the music database hashing has changed with OS 3.2 again. As the OS will also be used on current iPhone and iPod Touch models, libgpod will have to gain support to support the new hashing aswell.

Summary

In this article we have covered how to jailbreak your iPad with ease, and without Windows or OS X.


Further resources on this subject:


Linux Email Set up, maintain, and secure a small office email server
Published: November 2009
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:

About the Author :


Delan Azabani is a Linux and web developer based in Western Australia. In his spare time, he writes articles about web applications and Linux topics. He has extensive experience in PHP, JavaScript and C++, and can be reached at his website, http://azabani.com/, or by email, at delan.azabani@gmail.com.

Books From Packt


Books from Packt

Getting started with Audacity 1.3
Getting started with Audacity 1.3

jQuery 1.4 Reference Guide
jQuery 1.4 Reference Guide

MooTools 1.2 Beginner's Guide
MooTools 1.2 Beginner's Guide

Joomla! 1.5 Templates Cookbook
Joomla! 1.5 Templates Cookbook

FreeSWITCH 1.0.6
FreeSWITCH 1.0.6

NetBeans Platform 6.9 Developer's Guide
NetBeans Platform 6.9 Developer's Guide

Magento 1.3: PHP Developer's Guide
Magento 1.3: PHP Developer's Guide

Practical Plone 3: A Beginner's Guide to Building Powerful Websites
Practical Plone 3: A Beginner's Guide to Building Powerful Websites


No votes yet
Error by
I run into an error when I try to run the makefile in the directory
Soved: Error building spirtt-linux by
When I type "make" in the spirit-linux directory, I get the following: gcc -std=gnu99 -c -o spirit.o spirit.c spirit.c:28: fatal error: openssl/sha.h: No such file or directory compilation terminated. make: *** [spirit.o] Error 1 It worked after installing libssl-dev. I'm running Ubuntu Maverick.

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
i
1
x
d
B
W
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software