Thursday Night

Paul Betts’s personal website / blog / what-have-you

Listen to your music from anywhere using Ubuntu and SSH

What you’ll need

First, you’ll need a compatible iTunes music server. Unfortunately, Apple has decided to make their own music sharing intentionally incompatible with other applications. Thanks Apple. Instead, I’m using Firefly Media Server, which iTunes will gladly connect to.

In general, our goals are to tunnel port 3689 over SSH so that when programs connect to localhost:3389, they’ll instead get the remote music server. Then, we’re going to rig Avahi (the Bonjour implementation that handles “announcing” services over a local network) to register localhost:3689 as a valid music server.

The commands

SSH into your machine, and set up the tunnel:

ssh -L 6689:localhost:3689

Now here’s a tricky part that I had to figure out: by default, Avahi will register services to your normal IP address, yet SSH will only forward traffic over the loopback address ( We instead have to create a fake hostname that points to localhost, then create a service entry for that hostname.

avahi-publish-address Me.local &
avahi-publish-service -H Me.local Firefly _daap._tcp 6689

Spin up Banshee, and you should see Firefly show up in the shared library list. This only will work on your machine though, it’s not shared across the local network (even though other people can probably see it in their iTunes apps).

Written by Paul Betts

May 8th, 2010 at 2:41 pm

Posted in Apple,Linux