Table of Contents

[HOWTO] Sync iPod Touch with Ubuntu 7.10

Amarok and gtkpod can wirelessly sync music with iPod Touch and iPhone, including adding, editing and playing songs and playlists.

This guide requires Ubuntu 7.10.

Warning: While this guide works fine for most users, making unsupported changes to your iPhone or iPod Touch is done at your own risk and could result in data loss and possibly void your warranty. Follow this guide with care.

Before using this guide, you must first jailbreak the ipod touch.

Set up the iPhone or iPod

From the iPod home screen:

  1. Click Settings → General – Set Auto-lock to Never. This will ensure the iPod keeps the Wi-Fi connection open.
  2. Click the Home Button → Settings → Wi-Fi – Select your WiFi network. Click the Static button and change the IP Address to an address outside the dynamically assigned range of your network. This will ensure your iPod is always contactable at the same address for syncing.
  3. Open Installer
  4. Click All Packages → OpenSSH → Install
  5. Click All Packages → BSD Subsystem → Install

Set up Ubuntu

A third party source provides the ipod convenience package needed to properly mount and unmount an iPhone or iPod Touch, and for gtkpod users, a newer gtkpod that's required for the iPhone and iPod Touch.

  1. Click Settings → Repositories → Third Party Software. Click Add and use this as the APT line: deb http://ppa.launchpad.net/ipod-touch/ubuntu gutsy main
  2. Close Settings and Click Reload
  3. Find and install ipod-convenience.
  4. Find and install gtkpod. When asked, enter the IP address of your iPod Touch or iPhone that you selected earlier.

You should now be able to mount/unmount your iPod using the following commands in a terminal (Do not use Alt+F2):

$ ipod-touch-mount
$ ipod-touch-umount

When entering the above commands, you will be prompted to enter your iPod's root password. By default, dottie in firmware 1.0 and alpine in 1.1.x

Determine your GUID

iPod Touch users only, skip this step if you are using an iPhone.

The iPod Touch requires you to create a file that is used when generating the iTunesDB and ArtworkDB which store the information of which files are on the iPod. Plug in your iPod Touch to your Ubuntu computer and run this command in a terminal:

$ sudo lsusb -v | grep -i Serial

You will receive an output similar to this:

iSerial                 3 8089e2ce5193625c38813ec10fad4032ec839c02
iSerial                 1 0000:00:1d.7
iSerial                 1 0000:00:1d.2
iSerial                 1 0000:00:1d.1
iSerial                 1 0000:00:1d.0

Now what you are interested in is the first 16 characters of that really long string. This is the GUID. You'll now place a copy of the GUID in iPod Touch for syncing apps to use.

  1. SSH into your iPod from a terminal:
    $ ssh root@<Your iPod's IP Address>
  2. Create the directory structure if necessary:
    $ mkdir -p /var/root/Media/iTunes_Control/Device
  3. Create the file for the GUID. Be sure to replace the 16 character string you found with the one after the 0x in this example.
    $ echo "FirewireGuid: 0x8089e2ce5193625c" > /var/root/Media/iTunes_Control/Device/SysInfo

gtkpod

  1. Open gtkpod: Click Applications → Sound and Video → gtkpod
  2. If the “Add new iPod window” doesn't popup automatically: In the menu, click Edit → Edit Repository/iPod Options and click “Add new repository/iPod”
  3. Determine your iPod Model string by selecting from the drop-down list or entering it manually into the box.

When you first open gtkpod you may receive some errors. Simply click OK to proceed.

Simply add music to the iPhone or iPod Touch like you would any other iPod and Save Changes when done.

Extras

Passwordless Access

In order for programs like Amarok to connect to your iPhone via SSH without asking for a password, you can set up key based logins. You can skip this step if you're happy typing your password each time.

  1. Make a private and a public RSA key, if you don't have one already. Run the following command in Ubuntu, and when prompted, accept the default location, and don't enter any passphrase1).
    $ ssh-keygen -t rsa
  2. Copy your public key to the device (you will be asked for the iPod's root password again):
    $ ssh-copy-id -i ~/.ssh/id_rsa.pub root@<Your iPod's IP Address>
  3. SSH into your iPod from a terminal2):
    $ ssh root@<Your iPod's IP Address>
  4. Change your iPods password. This is important for security. You'll be logging in via your key anyway, but make it something you'll remember:
    $ passwd
  5. Edit /etc/sshd_config using nano (or other editor):
    $ nano /etc/sshd_config
  6. In your chosen editor, scroll down to the segment beginning with '#RSAAuthentication', and set it up as follows:
    RSAAuthentication yes
    PubkeyAuthentication yes
    AuthorizedKeysFile .ssh/authorized_keys

    Remove any hashes (#) at the beginning of these three lines.

  7. Hit Ctrl+X to exit, and save your changes.
  8. At this point you should be finished. Reboot your device:
    $ reboot
  9. Rebooting will end your SSH session.

You should now be able to SSH in to your iPod without being asked for a password.

If you're still asked for a password:

1) This will create a hidden directory called .ssh in your user's home directory, and place three files in there: id_rsa, id_rsa.pub, and known_hosts. id_rsa is your private keyfile; do not let anyone see it. id_rsa.pub is your public one which can be added to any machine's authorized_keys list. You want your iPod to have the public key.
2) The SSH service will still prompt for a password, as public key auth is not yet configured.