====== [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: - Click Settings -> General -- Set Auto-lock to Never. This will ensure the iPod keeps the Wi-Fi connection open. - 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. - Open Installer - Click All Packages -> OpenSSH -> Install - 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. - Open up [[Synaptic Package Manager]] - 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%%'' - Close Settings and Click Reload - Find and install ''ipod-convenience''. - 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. - SSH into your iPod from a terminal:$ ssh root@ - Create the directory structure if necessary:$ mkdir -p /var/root/Media/iTunes_Control/Device - 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 ===== - Open gtkpod: Click Applications -> Sound and Video -> gtkpod - 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" - 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. - 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 passphrase((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.)).$ ssh-keygen -t rsa - 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@ - SSH into your iPod from a terminal((The SSH service will still prompt for a password, as public key auth is not yet configured.)):$ ssh root@ - 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 - Edit ''/etc/sshd_config'' using nano (or other editor):$ nano /etc/sshd_config - 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_keysRemove any hashes (#) at the beginning of these three lines. - Hit Ctrl+X to exit, and save your changes. - At this point you should be finished. Reboot your device:$ reboot - 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: * Check your local ''~/.ssh/id_rsa.pub'' file and compare it with the ''~/.ssh/authenticated_keys'' file on your iPod. Does any entry match? If not, try the ''ssh-copy-id'' command again. Alternatively, just copy the contents of your ''id_rsa.pub'' file and paste it on a line of its own in ''authenticated_keys''. Entries **must** be one line only. * Did you properly input and save the changes to /etc/sshd_conf? * Did you reboot the iPod or iPhone after changing /etc/sshd_conf? * If you used a tool other than ssh-copy-id, check the permissions for your SSH files. If you type the following command, it should look like this: $ ls -al ~/.ssh total 4 drwxr-xr-x 2 root wheel 102 Nov 21 04:25 . drwxr-xr-x 6 root wheel 306 Nov 20 00:02 .. -rw-r--r-- 1 root wheel 395 Nov 20 03:01 authorized_keys